def truncate(self, path, length, fh=None): if path != PATH_MODULES: raise fuse.FuseOSError(errno.EPERM) if length != 0: self._log.debug("Must completely truncate the modules file.") raise IOError(errno.EPERM) reset_modules_list()
def __init__(self, path, flags, **kw): if path == PATH_MODULES: self.append = flags & os.O_APPEND if flags & os.O_RDWR: log.debug("Cannot allow readwrite access. Flags: {}".format( flags )) raise IOError(-errno.EPERM) if flags & os.O_TRUNC: reset_modules_list() else: if flags & os.O_WRONLY or flags & os.O_RDWR: log.debug("Cannot write to Python objects. Flags: {}".format( flags )) raise IOError(-errno.EPERM) self.path = path
def open(self, path, flags): if path == PATH_MODULES: if flags & os.O_RDWR: self._log.debug( "Cannot allow readwrite access. Flags: {}".format(flags)) raise fuse.FuseOSError(errno.EPERM) if flags & os.O_TRUNC: reset_modules_list() else: if flags & os.O_WRONLY or flags & os.O_RDWR: self._log.debug( "Cannot write to Python objects. Flags: {}".format(flags)) raise fuse.FuseOSError(errno.EPERM) fh = self._next_fh.next() self._flags_for_open_files[fh] = flags return fh
def truncate(self, path, len, *args): if path != PATH_MODULES: raise IOError(-errno.EPERM) if len != 0: raise IOError(-errno.EPERM) reset_modules_list()