def rename(self, from_path, to_path):
_complain_ifclosed(self.closed)<EOL>return self.fs.rename(from_path, to_path)<EOL>
Rename file.

:type from_path: str
:param from_path: the path of the source file
:type to_path: str
:param to_path: the path of the destination file
:raises: :exc:`~exceptions.IOError`