In perl,how can I know how long a specific file has been existing?
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.
精彩评论