ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: move-test fails on Windows7
Date Sun, 25 Apr 2010 06:13:03 GMT
On 2010-04-23, Matt Benson <> wrote:

> On Apr 23, 2010, at 3:08 AM, Stefan Bodewig wrote:

>> The problem is this code in Move#renameFile

>>             sourceFile = getFileUtils().normalize
>> (sourceFile.getAbsolutePath()).getCanonicalFile();
>>             destFile = getFileUtils().normalize
>> (destFile.getAbsolutePath());
>>             if (destFile.equals(sourceFile)) {
>>                 //no point in renaming a file to its own canonical
>> version...
>>                 log("Rename of " + sourceFile + " to " + destFile
>>                     + " is a no-op.", Project.MSG_VERBOSE);
>>                 return true;
>>             }

>> Using Win7 destFile.equals(sourceFile) returns true so no attempt is
>> even made to rename "abc" to "aBc".  Using WinXP it must have returned
>> false (can't test it anymore).

> IIRC the purpose is to detect the attempted rename of a file to its
> own canonical name, e.g. when the original name case-insensitively
> equals the target name on a case-insensitive filesystem.

OK, you mean in a situation where the file is called "abc" on the disk
and we reach it via new File("ABC") then we don't want to rename it to
"abc" (because that already is the name on disk).

Given that new File("abc").equals(new File("ABC")) on Win7 now we
probably better modify the test to compare the file names directly
rather than the File objects.

Am I getting this right?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message