You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Colm MacCarthaigh <co...@stdlib.net> on 2005/08/08 02:58:53 UTC
[PATCH] add "remove empty directories" option to htcacheclean
On Mon, Aug 08, 2005 at 12:04:44AM +0100, Colm MacCarthaigh wrote:
> Well that's a pretty each race to solve within httpd. It won't be able
> to create the headers, or the body. The patch I've submitted cleans up
> that slight race. The file won't be cached on that serve, but I don't
> think that's a big deal :-)
And since nothing says it like code, here's a patch to htcacheclean
which adds a -t option to clean out empty directories.
--
Colm MacCárthaigh Public Key: colm+pgp@stdlib.net
Re: [PATCH] add "remove empty directories" option to htcacheclean
Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
--On August 8, 2005 1:58:53 AM +0100 Colm MacCarthaigh <co...@stdlib.net>
wrote:
> And since nothing says it like code, here's a patch to htcacheclean
> which adds a -t option to clean out empty directories.
Thanks! Committed a variant in r231351.
FWIW, I agree with Andreas and Rüdiger. =) -- justin
Re: [PATCH] add "remove empty directories" option to htcacheclean
Posted by Colm MacCarthaigh <co...@stdlib.net>.
On Mon, Aug 08, 2005 at 02:11:12PM +0200, r.pluem@t-online.de wrote:
> What makes you think so? As previously stated this works on Unix systems and
> according to MS API doc it (RemoveDirectory) should behave in the same manner
> on Windows. I was not able to check the OS/2 code, as I found no documentation
> for DosDeleteDir, but I think this is an acceptable blind spot here.
DosDeleteDir on OS2 behaves like rmdir() iirc, from the IBM 3995 Optical
Library Dataserver "Reference for C-Series Models" (of all places);
DosDeleteDir -- DosRmDir
Definition: Remove a subdirectory from the specified disk
Remarks: This command removes a subdirectory from the specified
disk. Directories must be empty.
Actually, one of my worries was beos, where I remember there being a
recursive delete version of rmdir(), and getting bitten by it :)
Anyway, it's definitely safe to use.
--
Colm MacCárthaigh Public Key: colm+pgp@stdlib.net
Re: [PATCH] add "remove empty directories" option to htcacheclean
Posted by r....@t-online.de.
Colm MacCarthaigh wrote:
> On Mon, Aug 08, 2005 at 12:41:56PM +0200, Andreas Steinmetz wrote:
>
>>Colm MacCarthaigh wrote:
>>
>>>On Mon, Aug 08, 2005 at 12:04:44AM +0100, Colm MacCarthaigh wrote:
[..cut..]
>>
>>Up to the apache maintainers to decide. One question, though. Why do you
>> introduce directory_empty()? A blind call to apr_dir_remove() should be
>>sufficient. It will fail if the directory is not empty and succeed if it is.
>
>
> See my other comments about APR not claiming to ensure this behaviour.
>
What makes you think so? As previously stated this works on Unix systems and
according to MS API doc it (RemoveDirectory) should behave in the same manner
on Windows. I was not able to check the OS/2 code, as I found no documentation
for DosDeleteDir, but I think this is an acceptable blind spot here.
Regards
Rüdiger
Re: [PATCH] add "remove empty directories" option to htcacheclean
Posted by Colm MacCarthaigh <co...@stdlib.net>.
On Mon, Aug 08, 2005 at 12:41:56PM +0200, Andreas Steinmetz wrote:
> Colm MacCarthaigh wrote:
> > On Mon, Aug 08, 2005 at 12:04:44AM +0100, Colm MacCarthaigh wrote:
> >
> >>Well that's a pretty each race to solve within httpd. It won't be able
> >>to create the headers, or the body. The patch I've submitted cleans up
> >>that slight race. The file won't be cached on that serve, but I don't
> >>think that's a big deal :-)
>
> Up to the apache maintainers to decide. One question, though. Why do you
> introduce directory_empty()? A blind call to apr_dir_remove() should be
> sufficient. It will fail if the directory is not empty and succeed if it is.
See my other comments about APR not claiming to ensure this behaviour.
--
Colm MacCárthaigh Public Key: colm+pgp@stdlib.net
Re: [PATCH] add "remove empty directories" option to htcacheclean
Posted by Andreas Steinmetz <as...@domdv.de>.
Colm MacCarthaigh wrote:
> On Mon, Aug 08, 2005 at 12:04:44AM +0100, Colm MacCarthaigh wrote:
>
>>Well that's a pretty each race to solve within httpd. It won't be able
>>to create the headers, or the body. The patch I've submitted cleans up
>>that slight race. The file won't be cached on that serve, but I don't
>>think that's a big deal :-)
Up to the apache maintainers to decide. One question, though. Why do you
introduce directory_empty()? A blind call to apr_dir_remove() should be
sufficient. It will fail if the directory is not empty and succeed if it is.
--
Andreas Steinmetz SPAMmers use robotrap@domdv.de