This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Patch: java.io.File


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]