At 06:21 PM 05/23/2001, Greg Stein wrote:
On Wed, May 23, 2001 at 09:17:57AM -0500, Ben Collins-Sussman wrote:
> "William A. Rowe, Jr." <[EMAIL PROTECTED]> writes:
> > Does it make sense to apply some lstat check against the tree, such that
> > symlinks' targets aren't blown away? I'm not clear if your patch
> > protects that or not.
>
> Good idea.


remove() on a symlink does *not* toss the target. It only removes the symlink.

If there are symlinks to directories, a recursive delete that doesn't check for symlinks could end up walking out of the tree being deleted.


Think about it: remove tosses the directory entry. The symlink handles
interaction with the file. We aren't touching the file, so we don't get hit
by the symlink.


So... don't do an lstat. That is just wasteful and unneeded.

If this were a normal delete, that would be the case. Since this is a recursive delete, it needs to be handled.


--
Greg Marr
[EMAIL PROTECTED]
"We thought you were dead."
"I was, but I'm better now." - Sheridan, "The Summoning"



Reply via email to