[NTLUG:Discuss] original file creation date?

Eric Schnoebelen eric at cirr.com
Tue Sep 2 11:14:38 CDT 2008


Kenneth Loafman writes:
- Linux does have the concept of preservation of attributes.  In other
- words, 'cp -p src tgt' will preserve the time/date stamps and file modes
- when the file is copied, however, it will be considered 'modified' if
- you do not add the '-p' option, or if you copy it into the system from
- another place.

Are you absolutely, positively sure?  I bet if you triple checked,
you'd find that ``cp -p'' only copies access time (atime) and
modification time (mtime).  Inode creation time (ctime) is still
updated. (there exists no system call to set the inode creation
time.)

-                 The camera download programs must be setting the
- creation time, otherwise it would be identical to the modification time.
-  It would be trivial for them to set the modification time as well, but
- that would not match the normal semantics.

No, the creation time can be newer than the modification time.
inode creation time can  never be updated.  inode/file access and
modification times can be updated by the utime(2) system call.

--
Eric Schnoebelen		eric at cirr.com		http://www.cirr.com
	License plate seen on a car speeding by me: 4VRLATE



More information about the Discuss mailing list