Patch: java.io.File
Jeroen Frijters
jeroen@sumatra.nl
Mon Sep 6 20:35:00 GMT 2004
Bryce McKinlay wrote:
> >+ ((p.charAt(1) >= 'a' && p.charAt(1) <= 'z') ||
> >+ (p.charAt(1) >= 'A' && p.charAt(1) <= 'Z')) &&
> >
> >
> ... but I wonder if these tests are neccessary. It's probably
> sufficient, and faster, to just test this:
>
> >+ p.charAt(2) == ':')
I don't think that's a worthwhile optimization and given all the weird
paths that Windows supports it is a bit risky too. I tested what Sun
does and they also don't normalize paths that don't have a drive letter
in front of the colon.
Michael Koch wrote:
> Didnt some Windows NT supported drive names like 'AA', 'AB', 'AC' ...
> 'ZZ' ? i don't know for sure but I think I read this somewhere.
No, it definitely doesn't. One weird feature it does support is multiple
streams in one file and they also use a colon for that.
C:\>dir foo.txt
Volume in drive C is ThinkPad_7200RPM
Volume Serial Number is CC7E-00E9
Directory of C:\
09/05/2004 09:55 5 foo.txt
1 File(s) 5 bytes
0 Dir(s) 9,679,994,880 bytes free
C:\>type foo.txt
bar
C:\>more < foo.txt:my_2nd_stream
this is another stream
This combined with the Java "feature" of chopping off the leading
slashes makes some paths (like "\c:foo") ambiguous.
Regards,
Jeroen
More information about the Java-patches
mailing list