MksnapshotFS.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:mkbackup-btrfs 作者: xundeenergie 项目源码 文件源码
def __lsdir(self,path):#
        if DEBUG: print "ls dir"
        ss = path.split('/')[1]
        subdir = '/'+'/'.join(path.split('/')[2:])
        dirents = ['.', '..']
        #if path == "/" and (self.root.strip('/') == self.BDIRS['loc'].strip('/') or self.root == self.BDIRS['ext'].strip('/')):
        if path == "/" and (self.root in self.BDIRS.values()):
            self.root = self.BDIRS['loc']
            dirents.extend(self.snapshots.keys())
        elif ss in self.snapshots or path == "./":
            dirents.extend(os.listdir(self.__realpath(path)))
        else:
            self.root = self.BDIRS['loc']
            dirents.extend(os.listdir(path))
        return dirents


#    def mythread(self):
#
#        """
#        The beauty of the FUSE python implementation is that with the python interp
#        running in foreground, you can have threads
#        """
#        print "mythread: started"
#        while 1:
#            time.sleep(120)
#            print "mythread: ticking"
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号