- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Modification time and creation time
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2004 06:11 AM
05-13-2004 06:11 AM
Is there a way to display creation time on HP-UX ?
I must display the three different times of a file.
I use the perl stat function. It happens that modification and creation time are always the same.
If I use "ls -l" and "ls -lu", I can see access and modification date, but not creation.
It seems to me like creation time is not really stored.
Fred
"Reality is just a point of view." (P. K. D.)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2004 06:20 AM
05-13-2004 06:20 AM
Re: Modification time and creation time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2004 06:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2004 06:23 AM
05-13-2004 06:23 AM
Re: Modification time and creation time
Remember any syscall that modifies the inode meta data will effect the time shown by "ls -lc" - I would be curious to know if there is a way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2004 06:45 AM
05-13-2004 06:45 AM
Re: Modification time and creation time
The 3 time fields defined in a file inode are-
ctime inode change date/time (ie chmod file)
mtime data content change of file (ie vi file)
atime data content read of file (ie cat file)
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2004 07:02 AM
05-13-2004 07:02 AM
Re: Modification time and creation time
Rodney,
I do not agree with one point :
vi changes the creation time. Try it, and see. That's exactly what confused me. I thought that was because of vi edits a copy of the file, but if you do :
echo >> myfile
creation date is also changed, whereas it should absolutly not (inode is not touched).
If you want another example : /etc/passwd. I imagine that creation time shouldn't be equal to modification time, but...
Regards,
Fred
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2004 07:19 AM
05-13-2004 07:19 AM
Re: Modification time and creation time
Ctime is absolutely, positively not creation time; there just ain't no such animal. If any one of these 3 fields happens to coincide with the actual time the file was created, it's just that, coincidence.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2004 07:29 AM
05-13-2004 07:29 AM
Re: Modification time and creation time
So if I understand, when I issue
echo >> myfile
ctime is changed cause opening and writing the file are issuing adjustments on the permissions (even if I am already owner).
So ctime and mtime will only be different after a chmod, chowner...
It's always a pleasure to have an answer from you.
Best regards,
Fred
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2004 07:37 AM
05-13-2004 07:37 AM
Re: Modification time and creation time
I think this is a known issue with 11.11 (PHCO_28530) and 11.23 where the st_ctime is changed because utime gets called. I tested this using the touch command. The behaviour is the same. I shall try this on a 11.00 system too. And also try after installing PHCO_28530.
Rgds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2004 07:59 AM
05-13-2004 07:59 AM
Re: Modification time and creation time
echo "XXX" > myfile
ls -l myfile (modification time)
ls -lc myfile (change time)
ls -lu myfile (access time)
wait about 2 minutes
echo "YYY" >> myfile
and repeat the 3 ls commands
wait about 2 more minutes
chmod 640 myfile
ls -l myfile (mtime)
ls -lc myfile (ctime)
Again, if you happen to know the time a file was created, it's only accidental.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2004 08:05 AM
05-13-2004 08:05 AM
Re: Modification time and creation time
I understand and agree with that. Also your test runs fine, and I have the three times different.
What confused me was just that if you invert the two last (first chmod, then >>), you will have ctime=mtime. (but due to your precedent post, it's clear to me)
Regards,
Fred
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2004 08:21 AM
05-18-2004 08:21 AM
Re: Modification time and creation time
The touch(1) manpage documents the following:
DESCRIPTION
touch updates the access, modification, and last-change times of each
argument.
For vi, it makes changes into a tmp file until the file is saved, when it then removes the old file and renames the tmp file to the old name.
Hope this clarifies why ctime is updated.