File.getCanonicalPath on Windows?

Adam Megacz gcj@lists.megacz.com
Thu Jun 13 14:08:00 GMT 2002


Tom Tromey <tromey@redhat.com> writes:
> >>>>> "Adam" == Adam Megacz <gcj@lists.megacz.com> writes:
>> Adam> I'll test it; post it here.
>> Appended.

Here's the output of PR6652's test case with your patch; you can see
the current working directory from my prompt:
 megacz@VMWARE z:/
 $ ./foo.exe
 z:
 megacz@VMWARE z:/
 $ cd xwt
 megacz@VMWARE z:/xwt
 $ ../foo.exe
 z:\xwt
 megacz@VMWARE z:/xwt
 $ cat > z:foo
 asdf
Here's the output from JDK1.4:
 megacz@VMWARE z:/
 $ java.exe -cp . foo
 Z:\
Now I should note that "z:foo.txt" *is* a valid path, so this is not
broken. However, what the JDK does makes more sense (appending a '\'
to drive letters), and we should be imitating the JDK anyways.
This isn't the only place where java.io.File is quirky/wierd on
mingw. I say commit your patch; I'll come back later and make some
Win32-specific cleanups at some point.
 - a
-- 
Sick of HTML user interfaces?
www.xwt.org


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /