当前位置: 首页>>代码示例>>Python>>正文


Python fuse.Direntry方法代码示例

本文整理汇总了Python中fuse.Direntry方法的典型用法代码示例。如果您正苦于以下问题:Python fuse.Direntry方法的具体用法?Python fuse.Direntry怎么用?Python fuse.Direntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在fuse的用法示例。


在下文中一共展示了fuse.Direntry方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: readdir

# 需要导入模块: import fuse [as 别名]
# 或者: from fuse import Direntry [as 别名]
def readdir(self, path, offset):
        if path == "/":
            for pid in self.tasks:
                result = fuse.Direntry(str(pid))
                result.type = stat.S_IFREG
                result.st_size = self.address_space_size

                yield result 
开发者ID:google,项目名称:rekall,代码行数:10,代码来源:address_space_fuse.py

示例2: readdir

# 需要导入模块: import fuse [as 别名]
# 或者: from fuse import Direntry [as 别名]
def readdir(self, path, offset):
        for item in top_level_dir.contents:
            yield fuse.Direntry(item.name) 
开发者ID:GunshipPenguin,项目名称:spreadsheetfs,代码行数:5,代码来源:main.py

示例3: readdir

# 需要导入模块: import fuse [as 别名]
# 或者: from fuse import Direntry [as 别名]
def readdir(self, path, offset):
        log('--readdir(%r)\n' % path)
        node = cache_get(self.top, path)
        yield fuse.Direntry('.')
        yield fuse.Direntry('..')
        for sub in node.subs():
            yield fuse.Direntry(sub.name) 
开发者ID:omererdem,项目名称:honeything,代码行数:9,代码来源:fuse-cmd.py

示例4: readdir

# 需要导入模块: import fuse [as 别名]
# 或者: from fuse import Direntry [as 别名]
def readdir(self, path, offset):  # {{{3
        # Bug fix: When you use the -o use_ino option, directory entries must have
        # an "ino" field, otherwise not a single directory entry will be listed!
        try:
            self.__log_call('readdir', 'readdir(%r, %i)', path, offset)
            node_id, inode = self.__path2keys(path)
            yield fuse.Direntry('.', ino=inode)
            yield fuse.Direntry('..')
            query = "SELECT t.inode, s.value FROM tree t, strings s WHERE t.parent_id = ? AND t.name = s.id"
            for inode, name in self.conn.execute(query, (node_id,)).fetchall():
                yield fuse.Direntry(str(name), ino=inode)
        except Exception, e:
            self.__except_to_status('readdir', e) 
开发者ID:SlavikMIPT,项目名称:tgcloud,代码行数:15,代码来源:dedupfs.py

示例5: readdir

# 需要导入模块: import fuse [as 别名]
# 或者: from fuse import Direntry [as 别名]
def readdir(self, path, offset):
        print('Readdir!')
        for e in os.listdir("." + path):
            yield fuse.Direntry(e) 
开发者ID:apache,项目名称:allura,代码行数:6,代码来源:accessfs.py

示例6: readdir

# 需要导入模块: import fuse [as 别名]
# 或者: from fuse import Direntry [as 别名]
def readdir(self, path, offset):
        print "readdir", path, offset
        dirents = [".", ".."]
        if path == "/":
            dirents.extend(["a", "b", "c"])
        else:
            dirents.extend(["fuse_live.mkv"])
        for r in dirents:
            yield fuse.Direntry(r) 
开发者ID:mfoetsch,项目名称:dlna_live_streaming,代码行数:11,代码来源:dlna_fuse.py

示例7: readdir

# 需要导入模块: import fuse [as 别名]
# 或者: from fuse import Direntry [as 别名]
def readdir(self, path, offset):
        debug('UnderlyingFs.readdir', path, offset)
        real_path = self._get_real_path(path)

        dirents = []
        if os.path.isdir(real_path):
            dirents.extend([ '.', '..' ])

        dirents.extend(os.listdir(real_path))

        # return a generator over the entries in the directory
        return (fuse.Direntry(r) for r in dirents) 
开发者ID:ibizaman,项目名称:pcachefs,代码行数:14,代码来源:pcachefs.py

示例8: readdir

# 需要导入模块: import fuse [as 别名]
# 或者: from fuse import Direntry [as 别名]
def readdir(self, path, offset):
        debug('VirtualFS.readdir', path, offset)
        virtual_path = self.get_relative_path(path)
        if virtual_path is not None:
            is_file = stat.S_ISREG(self.cacher.getattr(os.sep + virtual_path).st_mode)
            if is_file:
                yield fuse.Direntry('cached')
            else:
                for f in self.cacher.readdir(os.sep + virtual_path, offset):
                    yield fuse.Direntry(f.name)
            yield None

        if path == '/':
            yield fuse.Direntry(self.root) 
开发者ID:ibizaman,项目名称:pcachefs,代码行数:16,代码来源:vfs.py


注:本文中的fuse.Direntry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。