ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Duncan Davidson <dun...@x180.net>
Subject Re: Why can't <delete> just simply delete the directory?
Date Sun, 10 Dec 2000 23:45:48 GMT
On 12/10/00 12:55 PM, "Diane Holt" <holtdl@yahoo.com> wrote:

> --- James Duncan Davidson <duncan@x180.net> wrote:
>> There's no equivalent to 'rm -rf' in the java.io.File class -- so
>> chasing the tree down and nuking all files, then all directories,
>> back to the parent is the only way to do it.
> 
> Actually, that's what 'rm -rf' does -- if you tried to 'rmdir foodir'
> before you got rid of everything under it, it'd bark at you that foodir
> wasn't empty -- "just removing the directory without removing all the
> files first" isn't something you can do on any OS that I know of -- you'd
> end up with all those files still chewin' up disk-space for no good
> reason, since it wouldn't reuse that space until it knew it could, and
> just deleting the parent directory wouldn't be enuf to tell it that, which
> is why it's not going to let you do that (at the user-level anyway -- you
> could probably do some weird system-call stuff to make that happen, but
> why would you ever want to? -- that would be Bad).

Righto -- guess what I was trying to say is there isn't a
File.delete(boolean deleteChildrenAsWell) call which would be the equiv to
'rm -rf'

.duncan

-- 
James Duncan Davidson                                        duncan@x180.net
                                                                  !try; do()


Mime
View raw message