Subject: Re: atime mtime ctime
To: Steven M. Bellovin <smb@research.att.com>
From: Andrew Brown <atatat@atatdot.net>
List: netbsd-users
Date: 11/29/2000 14:30:19
>Right -- note that you said "file name". But as I pointed out, file
>names are in directories, and the timestamps are in i-nodes, which
>leaves the question of link() (and, later on, rename(), though that's a
>relatively recent addition) problematic.
i think a timestamp that was set when the inode was allocated would
probably satisfy this curiosity. consider this (and assume that itime
is the inode allocation time):
[1]% command-1 > /tmp/foo
[2]% command-2 > /tmp/foo
[3]% echo foo | dd of=/tmp/foo conv=notrunc
[4]% cat /tmp/foo > /dev/null
[5]% touch /tmp/foo
[6]% rm /tmp/foo
[7]% command-3 > /tmp/foo
after [1]: ctime == 1, mtime == 1, atime == 1, itime == 1 (creation)
after [2]: ctime == 2, mtime == 2, atime == 1, itime == 1 (truncate, modify)
after [3]: ctime == 2, mtime == 3, atime == 1, itime == 1 (modify only)
after [4]: ctime == 2, mtime == 3, atime == 4, itime == 1 (access)
after [5]: ctime == 5, mtime == 5, atime == 5, itime == 1 (change inode)
after [6]: file does not exist so inode is deallocated
after [7]: ctime == 7, mtime == 7, atime == 7, itime == 7 (creation)
the question of how long a particular filename has referred to a
specific inode would have to be addressed at the directory entry
level, and would probably not be very helpful. imho.
--
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org * "ah! i see you have the internet
twofsonet@graffiti.com (Andrew Brown) that goes *ping*!"
andrew@crossbar.com * "information is power -- share the wealth."