<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def mkdir(self, tid, mode):
 """ Directory creation. Search is performed. Parameters tid : str Path to file. Original `path` argument is converted to tuple identifier by ``_pathdec`` decorator. mode : int Ignored. """


        pt = self.PathType.get(tid)

        if pt is self.PathType.invalid or pt is self.PathType.file:
            raise FuseOSError(errno.EPERM)

        if self.__exists(tid):
            raise FuseOSError(errno.EEXIST)

        try:
            dir_ent = YTActions(tid[0])
            dir_ent.updateResults()
        except ConnectionError:
            raise FuseOSError(errno.ENETDOWN)

        self.searches[tid[0]] = dir_ent # now adding directory entry is legit, nothing failed.

        return 0