> On Aug 19, 2004, at 1:58 PM, Randal L. Schwartz wrote: > > > The founding fathers of Unix deliberately left out "creation time" > > because the concept is ambiguous at best. There's some discussion on > > it in the classic materials about the early years of Unix. > > > > And I agree with the logic, and the conclusion. > > I'd like to read up on that. I'm sure the logic is solid, but I as I > said, I fail to figure it out on my own. > > > Unix *does* track the most recent time anything happens to a file or > > its metadata via ctime. That's probably close to "creation" as you > > would probably mean it or need it. > > This is what I'm mostly unclear on. What exactly does ctime represent? > I think the only descriptions I found said something like "ctime is not > the creation date of a file, it is the epoch seconds from the time the > script was started." >
Nope not script started (I believe there is a variable for this, check perlvar). It is an "inode change time" and is non-portable, see: perldoc -f stat and the 'stat' section of, perldoc perlport > When is a file's ctime modified? A few quick tests on my Mac OS X lead > me to conclude that this is not an accurate measure of when a file was > created but I may have missed something obvious. > The file's ctime is modified presumably whenever the inode changes, which is certainly when the file is created, *but* not *only* when the file was created, aka it can happen afterwards. Best example would be a disk defragger, repartitioning, etc. where a file's starting inode may get moved/changed (IIRC). From the perlport page Mac OS X doesn't even seem to be supported, even though it is just a *nix, though with UFS. Quoting perlport: "mtime and atime are the same thing, and ctime is creation time instead of inode change time. (Mac OS). ctime not supported on UFS (Mac OS X)." Basically you can't and shouldn't rely on it. HTH, http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>