是否有相当于 Mac OS X 的“添加日期”文件属性?

Sil*_*olf 5 filesystems directory timestamps files osx-finder

OS X 保留文件添加到当前所在文件夹的日期和时间,这对于排序很有用。是否有任何 Unix/Linux 文件系统或程序提供类似的功能?

这不是How do I do a ls and then sort the results by date create? 的重复项 因为我问的是它添加到文件夹的日期,而不是创建的日期。如果它被移动到其他地方,时间就会重置。

thr*_*rig 2

是的,尽管细节会有很大差异,无论是通过扩展stat(2)(macOS 做什么,何时_DARWIN_FEATURE_64_BIT_INODE定义),还是将该信息放入扩展文件属性或其他地方。例如 RFC 7530 中提到的 NFSv4

5.8.2.36.  Attribute 50: time_create

   The time of creation of the object.  This attribute does not have
   any relation to the traditional UNIX file attribute "ctime"
   ("change time").
Run Code Online (Sandbox Code Playgroud)

或者通过一些快速搜索来查找文件系统

btrfs otime
Ext4 crtime
UFS2 st_birthtime
ZFS crtime
Run Code Online (Sandbox Code Playgroud)

不过,此类接口以及所使用的特定库或软件产品是否支持此类接口都会有很大差异。

  • 那么,这不是文件创建时间,而不是添加日期时间吗? (2认同)