On 06-08-15, at 17:25,
wrote:
>
> On Aug 15, 2006, at 5:05 PM, wrote:
>
>> Ruby's file class has three methods for querying time related data:
>> atime, ctime and mtime. None of these will give me the creation
>> date of
>> a file. Anyone got a clue?
>
> There is no such thing as a creation time of a file. That is to
> say such information
> isn't stored in the filesystem.
That is incorrect. It is however, platform specific. On BSD systems,
the creation date of a file is stored, and can be retrieved using for
example, stat(1). Example:
% stat /bin/ls [17:32:52]
device 234881026
inode 1928485
mode 33133
nlink 1
uid 0
gid 0
rdev 0
size 32460
atime 1155674758
mtime 1111445359
ctime 1136127994
blksize 4096
blocks 64
link
Note the ctime. You can fetch this programmatically to.
That said, the creation time is the initial modification time in so
much as that it doesn't record when the file was created, but rather,
when it was created on the filesystem. So your document could be 30
years old, the ctime will report the time you put it on the filesystem.
> Gary Wright
--
Jeremy Tregunna
"One serious obstacle to the adoption of good programming languages
is the notion that everything has to be sacrificed for speed. In
computer languages as in life, speed kills." -- Mike Vanier