def getattr(self): st = DefaultStat() st.st_mode = stat.S_IFDIR | self.mode if self.count: if callable(self.count): st.st_nlink = 2 + self.count() else: st.st_nlink = 2 + self.count else: # Set a fallback nlink st.st_nlink = 1 return st
def getattr(self): st = DefaultStat() st.st_mode = stat.S_IFREG | self.mode st.st_size = len(self.contents) st.st_nlink = 1 return st