What about this one? I use the already-gotten dstInfo to test for attribute we don't want and clear them if they exist. Shouldn't be a lot of overhead in this case:

diff -u -r1.4 CopyTask.cs
--- src/NAnt.Core/Tasks/CopyTask.cs     26 Feb 2003 07:02:30 -0000      1.4
+++ src/NAnt.Core/Tasks/CopyTask.cs     3 Mar 2003 17:46:09 -0000
@@ -202,6 +202,8 @@

if (Overwrite || outdated) {
FileCopyMap.Add(srcInfo.FullName, dstFilePath);
+ if (dstInfo.Exists && dstInfo.Attributes != FileAttributes.Normal)
+ dstInfo.Attributes = FileAttributes.Normal;
}
} else {
string msg = String.Format(CultureInfo.InvariantCulture, "Could not find file {0} to copy.", srcInfo.FullName);


Philip Nelson wrote:

--- Matthew Mastracci <[EMAIL PROTECTED]> wrote:


This fixes the problem with read-only file destination for the <copy> task. If noone objects, I'll check this in.



snip


> if (File.Exists(dstPath))
> File.SetAttributes(dstPath, FileAttributes.Normal);



I would *love* to have this in but I would worry about performance when the file set is a network share instead of the local file system. I currently use the attrib task to accomplish the same thing. That would be almost as good if we had (maybe we do now?) fileset references like Ant does.

Since the copy task only copies over older files, if the attribute was only
reset if the file was actually going to be copied it might be OK.  I tend to
think it should still be optional though because some people may depend on the
current behaviour.


------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Nant-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-developers







-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to