def getattr(self, path, fh=None): logging.debug("getattr path={}, fh={}".format(path, fh)) node = node_utils.get_node(self.root_node, path) if not node: raise FuseOSError(ENOENT) return node.get_attrs()
def write(self, path, data, offset, fh): logging.debug("write path={} datalen={} offset={}".format( path, len(data), offset)) if path not in self.cache_registry: self.cache_registry[path] = Cache(cache_type=CacheType.UPSTREAM, ) self.cache_registry[path].append_data(data) node = node_utils.get_node(self.root_node, path) node.st_size = len(self.cache_registry[path].data) return len(data)
def write(self, path, data, offset, fh): logging.debug("write path={} datalen={} offset={}".format(path, len(data), offset)) if path not in self.cache_registry: self.cache_registry[path] = Cache( cache_type=CacheType.UPSTREAM, ) self.cache_registry[path].append_data(data) node = node_utils.get_node(self.root_node, path) node.st_size = len(self.cache_registry[path].data) return len(data)
def readdir(self, path, fh): logging.debug("readdir path: {}, fh: {}".format(path, fh)) node = node_utils.get_node(self.root_node, path) return [n.name for n in node.children]