def close(self):
        """
        Close the file.
        """
        if not self.closed:
            self.closed = True
            retval = self.f.close()
            if self.base_mode != "r":
                self.__size = self.fs.get_path_info(self.name)["size"]
            return retval