- 论坛徽章:
- 0
|
在LINUX上(和HP-UX同),st_ctime也不是真正的创建时间。
Q Is there any command on HP-UX which gives the file creation or modification time in seconds? 'ls -l' gives only hour and minute. I am looking for something like 'ls --full-time' on Linux.
A: There is no file creation time for HP-UX stored in the inode. The inode for a file contains last-modified time (shown by "ls -l"), a last-accessed time (shown by "ls -lu") and an inode change time (shown by "ls -lc"). The latter is often referred to as the "creation time" - even in some man pages - but that is incorrect. This time is also set by such operations as mv, ln, chmod, chown and chgrp. The man page for "stat(2)" discusses this in more detail.
The stat(2) call can be used from perl to get to the modification time seconds. For example, the following perl script will print the last modification time for "foo" in seconds since the epoch |
|