On 6 May 2005, at 16:09, Ciaran Johnston wrote:
> To be really pedantic, of course this doesn't answer the question,
> -mtime shows the last modification time, whereas an objective reading
> the question reveals that the requirement was to find the age of the
> not the time since last access.
As we're being pedantic, mtime doesn't measure the time of last access,
but rather the time of last modification - you may have been thinking
of atime. And IME when people ask "How old is that file ?" they mean
"When was it last modified?".
> Kevins answer does the same, so to answer
> the "real" question, whether or not it was the intended question, I
> haven't got a clue how to find the "creation time" of a file, and
> indeed I
> don't think it is possible.
It's not on Unix, and in the absolute, is it even a meaningful
question. If the file's data has changed completely since it was first
created, of what relevance is the first creation ?
If we once had a file /path/to/file which was erased and then later a
new file was created called /path/to/file whose content was then
changed, what is the age of that file? Do we date it by its last
modification date, or its most recent creation date? Why not its
original creation date?
The former I'd say is the most common and useful interpretation.
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!