- if 'path' in active_fields:
- print 'path:', m.path
- if 'mode' in active_fields:
- print 'mode:', oct(m.mode)
- if 'link-target' in active_fields and stat.S_ISLNK(m.mode):
- print 'link-target:', m.symlink_target
- if 'rdev' in active_fields:
- print 'rdev:', m.rdev
- if 'uid' in active_fields:
- print 'uid:', m.uid
- if 'gid' in active_fields:
- print 'gid:', m.gid
- if 'owner' in active_fields:
- print 'owner:', m.owner
- if 'group' in active_fields:
- print 'group:', m.group
- if 'atime' in active_fields:
- # If we don't have utimensat, that means we have to use
- # utime(), and utime() has no way to set the mtime/atime of a
- # symlink. Thus, the mtime/atime of a symlink is meaningless,
- # so let's not report it. (That way scripts comparing
- # before/after won't trigger.)
- if xstat.lutime or not stat.S_ISLNK(m.mode):
- print 'atime: ' + fstimestr(m.atime)
- else:
- print 'atime: 0'
- if 'mtime' in active_fields:
- if xstat.lutime or not stat.S_ISLNK(m.mode):
- print 'mtime: ' + fstimestr(m.mtime)
- else:
- print 'mtime: 0'
- if 'ctime' in active_fields:
- print 'ctime: ' + fstimestr(m.ctime)
- if 'linux-attr' in active_fields and m.linux_attr:
- print 'linux-attr:', hex(m.linux_attr)
- if 'linux-xattr' in active_fields and m.linux_xattr:
- for name, value in m.linux_xattr:
- print 'linux-xattr: %s -> %s' % (name, repr(value))
- if 'posix1e-acl' in active_fields and m.posix1e_acl and metadata.posix1e:
- flags = metadata.posix1e.TEXT_ABBREVIATE
- if stat.S_ISDIR(m.mode):
- acl = m.posix1e_acl[0]
- default_acl = m.posix1e_acl[2]
- print acl.to_any_text('posix1e-acl: ', '\n', flags)
- print acl.to_any_text('posix1e-acl-default: ', '\n', flags)
- else:
- acl = m.posix1e_acl[0]
- print acl.to_any_text('posix1e-acl: ', '\n', flags)
+ if metadata.verbose >= 0:
+ if not first_path:
+ print()
+ if atime_resolution != 1:
+ m.atime = (m.atime / atime_resolution) * atime_resolution
+ if mtime_resolution != 1:
+ m.mtime = (m.mtime / mtime_resolution) * mtime_resolution
+ if ctime_resolution != 1:
+ m.ctime = (m.ctime / ctime_resolution) * ctime_resolution
+ print(metadata.detailed_str(m, active_fields))
+ first_path = False