Re: keep original file creation date from changing
From: Lew Pitcher (lpitcher_at_sympatico.ca)
Date: Sat, 15 Jan 2005 10:09:03 -0500
-----BEGIN PGP SIGNED MESSAGE-----
Michael Hearne wrote:
> Lew Pitcher wrote:
>>>> Linux does not record or preserve a "file creation date"; there is no
>>>> way to preserve such a date within the filesystem metadata.
>> FWIW, Linux does place three different timestamps on each file and it's
>> up to the filesystem to physically record these timestamps.
>> The field st_atime is changed by file accesses, e.g. by
>> execve(2), mknod(2), pipe(2), utime(2) and read(2) (of
>> more than zero bytes). Other routines, like mmap(2), may
>> or may not update st_atime.
>> The field st_mtime is changed by file modifications, e.g.
>> by mknod(2), truncate(2), utime(2) and write(2) (of more
>> than zero bytes). Moreover, st_mtime of a directory is
>> changed by the creation or deletion of files in that
>> directory. The st_mtime field is not changed for changes
>> in owner, group, hard link count, or mode.
>> The field st_ctime is changed by writing or by setting
>> inode information (i.e., owner, group, link count, mode,
>> All three timestamps are initially set to the to the same value when the
>> file is created, and are changed independantly as the file is accessed.
> OK, if I understand it correctly, when I download a file, it becomes a
> new file (on my machine) and therefore gets a new creation date.
When you download a file, it becomes a new file (on your machine) and therefore
- a new last_file_access time (atime),
- a new last_file_modification time (mtime), and
- a new last_inode_modification time (ctime)
The file does /not/ get a new creation date; there /is no/ creation date.
Once the file is on your system,
- - if you browse the file, the last_file_access time changes with each browse
- - if you edit the file, the last_file_modification time changes with each edit,
- - if you change the file's attributes, the last_inode_modification time changes
with each attribute change
The 'creation date' is not preserved; there /is no/ creation date.
> spend some time on the manpages and see what I can learn. I'll probably
> head over to comp.unix.shell and lurk there for a while as well.
That's a good idea. comp.unix.shell is an interesting and active group.
> Thank you,
Master Codewright and JOAT-in-training
Registered Linux User #112576 (http://counter.li.org/)
Slackware - Because I know what I'm doing.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----