@_pathdec<EOL><INDENT>def rename(self, old, new):<DEDENT>
new = self.__pathToTuple(new)<EOL>if not self.__exists(old):<EOL><INDENT>raise FuseOSError(errno.ENOENT)<EOL><DEDENT>if self.PathType.get(old) is not self.PathType.subdir or self.PathType.get(new) is not self.PathType.subdir:<EOL><INDENT>raise FuseOSError(errno.EPERM)<EOL><DEDENT>if self.__exists(new):<EOL><INDENT>raise FuseOSError(errno.EEXIST)<EOL><DEDENT>try:<EOL><INDENT>new_dir_ent = YTActions(new[<NUM_LIT:0>])<EOL>new_dir_ent.updateResults()<EOL><DEDENT>except ConnectionError:<EOL><INDENT>raise FuseOSError(errno.ENETDOWN)<EOL><DEDENT>self.searches[new[<NUM_LIT:0>]] = new_dir_ent <EOL>try:<EOL><INDENT>del self.searches[old[<NUM_LIT:0>]]<EOL><DEDENT>except KeyError:<EOL><INDENT>raise FuseOSError(errno.ENOENT)<EOL><DEDENT>return <NUM_LIT:0><EOL>
Directory renaming support. Needed because many file managers create directories with default names, wich
makes it impossible to perform a search without CLI. Name changes for files are not allowed, only for
directories.

Parameters
----------
old : str
    Old name. Converted to tuple identifier by ``_pathdec`` decorator.
new : str
    New name. Converted to tuple identifier in actual function body.