Re: [PBML] How can I get a readable time stamp of a file?
- On Tue, Aug 29, 2000 at 03:11:55PM -0000, slavik914@... wrote:
> I would like to print out the time stamp on a file on a UNIX system.well, when you stat a file you get a list of values. the ones that have
> I've tried stat and I cant get something that is readable to a
> user. This is probably something that has been asked before here but
> I cant find it in the archives.
> I tried perldoc -f stat but either it doesnt explain in plain english
> or I'm dyslexic.
to do with time are:
8 atime last access time since the epoch
9 mtime last modify time since the epoch
10 ctime inode change time (NOT creation time!) since the epoch
so if you want to know when the file "/foo/bar" was last modified, you'd
$mtime = (stat ("/foo/bar"));
and to get a human readable for of that, just:
print scalar localtime($mtime);