1 from stat import S_IFDIR
6 # Initialize virtual root
10 # (dict of attrs, dict of children in folder)
13 def getattr(self, path):
14 paths = [p for p in path.split('/') if len(p) > 0]
18 st = dict(st_mode=(S_IFDIR | 0o755), st_nlink=2)
33 def getkids(self, path):
34 paths = [p for p in path.split('/') if len(p) > 0]
49 # Set a cache node's children and their attributes.
50 # This implicitly purges any prvious children from the cache.
51 # Thus, those directories will be re-scanned next time.
52 def setkids(self, path, children):
53 paths = [p for p in path.split('/') if len(p) > 0]
57 # We expect to be able to walk the path, because we can't get
58 # there without Linux' VFS stat'ing all directories leading up.
66 parent[p] = (st, children)