[BUG][Unix] ctime and mtime entries swapped in DirectoryEntry

Randal L. Schwartz merlyn at stonehenge.com
Wed Oct 22 14:27:44 UTC 2003


>>>>> "Alexander" == Alexander Lazareviæ <Alexander at Lazarevic.de> writes:

Alexander> Is the ctime changed if a file is opened for write? I thought it just gets 
Alexander> updated if the metadata changes? This is what I would read out of the gnu 
Alexander> libc documentation.

Think of "mtime" as "what make looks at"
Think of "ctime" as "what backup looks at, for incrementals"

So, anything that would make a file "backupworthy" updates ctime.
This has been the principle since the earliest days of Unix.  If Linux
didn't maintain this historical meaning, then Linux really *isn't*
Unix. :)

Alexander>    Reading from a file updates its access time attribute, and writing
Alexander> updates its modification time.

This is wrong.  It also updates ctime.

Alexander>   Renaming a file with
Alexander> `rename' affects only the attribute change time and modification time
Alexander> fields of the two parent directories involved, and not the times for
Alexander> the file being renamed.

This is wrong.  Either the docs are wrong, or the behavior is wrong.
Renaming a file *must* update its ctime, otherwise an incremental backup
fails.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



More information about the Squeak-dev mailing list