Пример #1
0
 def _add_common(self, path, st):
     assert (st.st_uid >= 0)
     assert (st.st_gid >= 0)
     self.size = st.st_size
     self.uid = st.st_uid
     self.gid = st.st_gid
     self.atime = st.st_atime
     self.mtime = st.st_mtime
     self.ctime = st.st_ctime
     self.user = self.group = ''
     entry = pwd_from_uid(st.st_uid)
     if entry:
         self.user = entry.pw_name
     entry = grp_from_gid(st.st_gid)
     if entry:
         self.group = entry.gr_name
     self.mode = st.st_mode
     # Only collect st_rdev if we might need it for a mknod()
     # during restore.  On some platforms (i.e. kFreeBSD), it isn't
     # stable for other file types.  For example "cp -a" will
     # change it for a plain file.
     if stat.S_ISCHR(st.st_mode) or stat.S_ISBLK(st.st_mode):
         self.rdev = st.st_rdev
     else:
         self.rdev = 0
Пример #2
0
 def _add_common(self, path, st):
     self.uid = st.st_uid
     self.gid = st.st_gid
     self.rdev = st.st_rdev
     self.atime = st.st_atime
     self.mtime = st.st_mtime
     self.ctime = st.st_ctime
     self.user = self.group = ''
     entry = pwd_from_uid(st.st_uid)
     if entry:
         self.user = entry.pw_name
     entry = grp_from_gid(st.st_gid)
     if entry:
         self.group = entry.gr_name
     self.mode = st.st_mode
Пример #3
0
 def _add_common(self, path, st):
     self.uid = st.st_uid
     self.gid = st.st_gid
     self.atime = st.st_atime
     self.mtime = st.st_mtime
     self.ctime = st.st_ctime
     self.user = self.group = ""
     entry = pwd_from_uid(st.st_uid)
     if entry:
         self.user = entry.pw_name
     entry = grp_from_gid(st.st_gid)
     if entry:
         self.group = entry.gr_name
     self.mode = st.st_mode
     # Only collect st_rdev if we might need it for a mknod()
     # during restore.  On some platforms (i.e. kFreeBSD), it isn't
     # stable for other file types.  For example "cp -a" will
     # change it for a plain file.
     if stat.S_ISCHR(st.st_mode) or stat.S_ISBLK(st.st_mode):
         self.rdev = st.st_rdev
     else:
         self.rdev = 0