ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 25770] - [PATCH] FixCRLF "preserveLastModified"
Date Fri, 23 Apr 2004 17:08:02 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=25770>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=25770

[PATCH] FixCRLF "preserveLastModified"





------- Additional Comments From jeremy@las-inc.com  2004-04-23 17:08 -------
I think there's a small bug in the proposed patch: FixCRLF can be used to 
overwrite existing files (when no destdir is given). If that is the case then 
the fileUtils.rename(tmpFile,destFile) is actually also overwriting srcFile, 
therefore you can't get the original timestamp anymore because the file is 
gone. I think this will work:
            if (destIsWrong) {
                long modified = srcFile.lastModified();
                fileUtils.rename(tmpFile, destFile);
                if (this.preserveLastModified)
                    destFile.setLastModified(modified);
                tmpFile = null;
            }

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


Mime
View raw message