开发者

In perl,how can I know how long a specific file has been existing?

开发者 https://www.devze.com 2023-03-16 03:19 出处:网络
I\'ve checked the doc but seems there\'s no such a column in the output of stat: 8 atimelast access time in seconds since the epoch

I've checked the doc but seems there's no such a column in the output of stat:

             8 atime    last access time in seconds since the epoch
             9 mtime    last modi开发者_如何学编程fy time in seconds since the epoch
            10 ctime    inode change time in seconds since the epoch (*)

Is it possible to know how long a specific file has been existing at all?


No, there is no way to obtain that information, because the file system on a POSIX system does not have a creation time field.

If your filesystem has extended attributes (xattr), it may store the file creation time. But then you would have to grab that using the xattr interface, not via stat.

And alas, Googling for "perl xattr" doesn't yield anything useful.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号