On Nov 29, 2010, at 8:55 AM, Paul Taylor wrote:
> On OSX it seems that if a file is compared with another file ( file1.equals(file2) ) it will mark them as different if they just change in case but when checking if a file exists (file1.exists()) it ignores case. It this correct, if so Im finding it counter-intuitive
As Sandro said, File.exists() calls down to the OS to see if the file exists. File.equals() does just does a string compare in java code. We have a really old bug on this <rdar://2844196> and so does Sun/Oracle - <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4787260>. Its probably a bigger deal on MacOSX since the filesystem is case insensitive by default.
The workaround is to use getCanonicalFile()/getCanonicalPath() and then compare those.
Pratik _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden