def open(self, directory=None, filename=None, mode="rb"):
        """Opens a file for writing or reading."""
        path = os.path.join(directory, filename)
        return open(path, mode)
Opens a file for writing or reading.