def chmod(self, path, mode):
_complain_ifclosed(self.closed)<EOL>try:<EOL><INDENT>return self.fs.chmod(path, mode)<EOL><DEDENT>except TypeError:<EOL><INDENT>mode = self.__compute_mode_from_string(path, mode)<EOL>return self.fs.chmod(path, mode)<EOL><DEDENT>
Change file mode bits.

:type path: str
:param path: the path to the file or directory
:type mode: int
:param mode: the bitmask to set it to (e.g., 0777)
:raises: :exc:`~exceptions.IOError`