You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2010/05/07 11:14:31 UTC

DO NOT REPLY [Bug 49261] Copy task fails to overwrite readonly files even with overwrite="true"

https://issues.apache.org/bugzilla/show_bug.cgi?id=49261

Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|                            |All

--- Comment #1 from Stefan Bodewig <bo...@apache.org> 2010-05-07 05:14:26 EDT ---
My guess is that our changed copy code using NIO is taking the target's
permissions into account whlie the old stream based approach did not.

overwrite really only says "write even if the dest isn't out of date" and never
had any influence on whether a readonly dest file would get overwritten.
If you create dest befaore source in your testcase Ant 1.7.1 will happily
overwrite dest without the overwrite attribute as well.

I must admit that I actually like the change - Ant shouldn't ignore the
read-only state if the destination.  We may want to throw in an additional
attribute that controls the behavior.

If my guess is correct then you can trick Ant into using the non-NIO code
by filtering- i.e. you could throw in a filter that doesn't change your
files.  This will not work for binary files.  Another "trick" would be to
ZIP or TAR up the sources and extract from there since the NIO code
is only used if source and dest are files and no filtering occurs at all.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.