ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
Subject Re: Doing Ant builds
Date Thu, 18 Jun 2009 15:54:11 GMT
Michael Ludwig wrote:
> Steve Loughran schrieb am 16.06.2009 um 16:47:55 (+0100):
>> Michael Ludwig wrote:
> 
>>> Okay, so you were talking about Java limitations in general, not Java
>>> limitations within the context of an Ant extension?
>> exactly.
> 
> Thanks for clarifying.
> 
>>> What you're saying about permissions reminds me of my initial post to
>>> this list after discovering that the <delete/> task on Windows will
>>> recursively and unconditionally remove directories - even when
>>> they're write-protected.
>> I suspect permissions in Windows are not what you think they are; that
>> write protect probably stops you adding stuff inside a directory, not
>> deleting it from above.
> 
> It doesn't stop me adding stuff inside it; it stops me removing the
> directory.
> 
> You're partially right, though: I can recursively delete a directory
> *containing* the write-protected directory, and it does not trigger a
> prompt asking "rm: remove write-protected directory `xxx/yyy'?" as on
> Linux. It simply and recursively removes the whole tree, never mind
> about dispensable write-protection.
> 
> Ant, however, goes one step further: It will remove a write-protected
> file, which will not work using Windows tools without force, and it will
> even recursively remove a write-protected directory. That's not at all
> intuitive, and I think you could argue it could be quite harmful.
> 

There's nothing complex going on in there, it just runs through every 
file in the list, starting at the bottom, and goes File.delete() on it; 
after deleting every file in a directory, it does the directory. I don't 
think its trying to be malicious.

If you want ant to honour write-protect options, you could probably 
extend delete to do it with a new attribute. Add the relevant tests and 
we'll put it in.

-steve


-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message