stealth technology for find(1)

Alexander Dupuy dupuy at cs.columbia.edu
Wed Aug 9 01:06:04 AEST 1989


The only problem with your fix is that by resetting the atime of the directory
to the old time, you also set the ctime of the directory to be the current
time.  While this is not always a problem, in some circumstatnces, you may be
more concerned with preserving the ctimes (e.g. for incremental backup
purposes) than you are with preserving the atime.

You could make your stealth code conditional on some sort of option flag for
find, but some will certainly argue that find already has to many options, and
that the subtleties of ctime/[am]time interactions are a bit too much for most
users of find to grasp.

For reference, the rules are:

Files:

	atime:	updated when created, read().

	mtime:	updated when created, write(), truncate().

	ctime:	updated when created, write(), truncate(), chown/chmod(),
		utime/utimes(), link/unlink/rename() of self.

Directories

	atime:	updated when created, read(), getdents/getdirentries().

	mtime:	updated when created, link/unlink/rename/rmdir() of entries.

	ctime:	updated when created, link/unlink/rename/rmdir() of entries,
		chown/chmod(), utime/utimes(), link/unlink/rename() of self. 

In general, the atime is updated whenever the data in a file is read, the mtime
is updated whenever the data in a file is modified, and the ctime is updated
whenever the data associated with the inode is changed.

@alex
--
-- 
inet: dupuy at cs.columbia.edu
uucp: ...!rutgers!cs.columbia.edu!dupuy



More information about the Comp.bugs.4bsd.ucb-fixes mailing list