當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。