XML Feeds

.

[java-dev] A strange error...

Siska Ádám sadam at startvox.hu
Sat Jun 30 13:01:03 MDT 2007


Hello Everyone,


I'm getting some very strange error, and I have no idea what can cause 
it. I'm trying to open a file with the following code:

File settings = new File ( Constants.SETTINGS_FILE );
if ( ! settings.exists ( ) ) {
    System.err.println ( settings.getCanonicalPath ( ) + ": Doesn't 
exist!" );
}
if ( settings.canRead ( ) ) {
    ( ... )
    ( ... )
    ( ... )
}

Now, if running this from Eclipse, everything works fine, I get the file 
and I can do the operations standing after the canRead() test. But, if 
running the same code from mxj, I get the "Doesn't exist" error. The 
funny is, that the filename returned with getCanonicalPath() points to a 
file in my filesystem that exists! And I'm sure it exists, because the 
same code in Eclipse should point to the same file, I suppose (and also 
because I looked it 100 times in Finder, and there are no misspellings 
in the file name).

Do you have any ideas?

Thank you,
Adam


________________
Siska Ádám
+36 (70) 207-63-85
http://apocalypse.rulez.org/~sadam


More information about the java-dev mailing list