Re: keep original file creation date from changing

From: Lew Pitcher (lpitcher_at_sympatico.ca)
Date: 01/15/05


Date: Sat, 15 Jan 2005 10:09:03 -0500


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Michael Hearne wrote:
> Lew Pitcher wrote:
[snip]
>>>> 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.
[snip]
>> 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,
>> etc.).
>>
>> 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.

Not quite.

When you download a file, it becomes a new file (on your machine) and therefore
gets
 - 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.

> I'll
> 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,

You're welcome

> Michael
>

- --
Lew Pitcher

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

iD8DBQFB6TIPagVFX4UWr64RAtSkAJ9ocWUJ3+oLeoTW+l7c7ksUcFKafwCfTdP3
7hSfaWSE8p2fArUMaqczFDE=
=H9uN
-----END PGP SIGNATURE-----



Relevant Pages

  • Re: Still asking to update..
    ... The creation and modification timestamps on the files on your machine are very odd. ... Make a copy of the folder VS80sp1-KB971023-X86-INTL which should be in the TEMP folder. ... 00:02 (all these dates are in Italian format) ...
    (microsoft.public.windowsupdate)
  • Re: Listing file name and date
    ... Do you know that the creation time is actually stored for entries in ... Unix filesystems traditionally store only three timestamps for each ... Most tools that query filesystem entries know how to get at most those ...
    (comp.unix.questions)
  • Re: Listing file name and date
    ... Do you know that the creation time is actually stored for that ... Unix filesystems traditionally store only three timestamps for each ... Most tools that query filesystem entries know how to get at most those ...
    (comp.unix.questions)