apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Marr <gr...@alum.wpi.edu>
Subject Re: [PATCH] apr_dir_remove_recursively
Date Wed, 23 May 2001 22:55:20 GMT
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." <admin@rowe-clan.net> 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 

>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
"We thought you were dead."
"I was, but I'm better now." - Sheridan, "The Summoning"

View raw message