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 [EMAIL PROTECTED]  2004-04-23 17:29 -------
Open mouth, insert foot... Just after clicked the "Commit" button it occurs to 
me that you really don't want to set the timestamp to 0, which is the value 
returned by File.lastModified() if anything goes wrong. So to be extra cautious 
I would recommend the following patch to my patch:
            if (destIsWrong) {
                long modified = srcFile.lastModified();
                fileUtils.rename(tmpFile, destFile);
                if (this.preserveLastModified && (modified!=0))
                    destFile.setLastModified(modified);
                tmpFile = null;
            }
Chances are that if you can't read the timestamp you can't set it either, so 
you might argue that this is overkill. But it's an easy thing to check, so we 
might as well. Perhaps it would also be a good idea to log the setting of the 
timestamp, and possibly the failure to read the timestamp?

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to