On Mon, Mar 2, 2009 at 4:34 PM, Niklas Gustavsson <[email protected]> wrote: > On Mon, Mar 2, 2009 at 11:52 AM, Ashish <[email protected]> wrote: >> Can't we create the name like File file = new >> File("FiLe"+System.currentTimeMillis()); >> check if it exists. Chance are very rare that it will. >> >> If it exist recreate a new file name. >> If it doesn't exist, we call file.createNewFile(); and do the case >> sensitive stuff. > > Problem is, we might be running on a read-only file system. Or, as > common with FTP servers, file systems that is being monitored by other > applications (over FTP or locally).
Can't we ship two weirdly name files with our distribution and test for equality on them :-) Or how about providing a default behavior(like we discussed) and provide a hook for customizing the same. >>> Would that work? Step 4 would mean taking a performance penalty if >>> there are lots of files in the parent directory, but it should not be >>> a very common case. >> >> I hope, we would be doing this once, to establish if File System is >> case sensitive or not. >> So performance shouldn't really be a big cause. > > Problem is, we don't know where file systems (as in the *nix sense) > change as you can mount or link file systems together where ever. So, > we pretty much have to do this on every equals... currently we don't > use equals so much so it would probably be okay, but the Javadoc must > come with a huge warning post if we decide to go with any of these > ideas for checking file equivalence. Yeah I got it :) May be I should take a break
