Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Path seperator character



Michael Hall <email@hidden> wrote:

>What I'm finding somewhat odd at the moment is the behavior of
>File("."). Now we were warned in a tech note actually that file handling
>on Classic wasn't _exactly_ Unix. So do not expect correct behavior for
>things like the above. But getting
>/Mac OS 9/Java/Combined/. for new File(".").getAbsolutePath();
>and
>/Mac OS 9/Java/Combined/./ext for new File("./ext").getAbsolutePath();
>is not what I expected the correct Unix based paths to be? Was I
>mistaken that Java would somehow resolve this minus the original '.'s?

File never did that automatically. You need File.getCanonicalPath() to
resolve out all the "." and ".." stuff, along with multiple adjacent
separators, and other chaff.

-- GG




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.