Пример #1
0
    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
Пример #2
0
    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
Пример #3
0
 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
Пример #4
0
 def getattr(self):
     st = DefaultStat()
     st.st_mode = stat.S_IFLNK | 0777
     return st
Пример #5
0
 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
Пример #6
0
 def getattr(self):
     st = DefaultStat()
     st.st_mode = stat.S_IFLNK | 0777
     return st