Subject: Re: CVS commit: src/usr.bin/find
To: None <tech-userlevel@netbsd.org>
From: James K. Lowden <jklowden@schemamania.org>
List: tech-userlevel
Date: 02/10/2007 17:13:16
Alan Barrett wrote:
> > I think adding this "-rm" alias is a bad idea.
> > (On the other hand, I'm one who asked Elad to add the -delete option.)
> 
> Why did any of this (the -delete option and the -rm option)
> happen without prior discussion?

More basically, could someone point me to a description of the problem
that '-delete' is intended to solve?  I found:

http://www.gnu.org/software/findutils/manual/html_node/find_html/Race-Conditions-with-_002dexec.html
http://www.xatrix.org/advisory.php?s=6312

Are they on-topic?  Was there any consensus that -delete addresses the
problem the best way?  (Sorry if I missed it.)  

David Maxwell wrote:
> Please review "cat -v Considered Harmful".

(http://netlib.bell-labs.com/cm/cs/doc/84/kp.ps.gz)  Instructive.  

> -delete ... exists to minimize a specific race condition
> opportunity because pipes pass filenames, not filehandles.

As Mouse said (approximately), it would be interesting to consider the
problem in terms of what find(1) would have to pass to a filter that could
do what -delete is meant for.  We know how to pass handles between
processes.  Might it be useful to make find(1) do that instead?  Various
handle-accepting filters could do different things with them, unlinking
being only one possibility.  

--jkl