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: Names of drives (was Re: A little help for a Mac newbie? :-))



Moises Lejter wrote:
| OK. Acrobat gives me a pathname "/A/B/C". On MacOSX, it looks like
| A is always the disk name, while /B/C is a pathname within that disk.
| My problem is that I cannot use what I get directly - /A/B/C does
| not exist on the filesystem. I have to use /B/C (if A is the book disk)
| or I guess /Volumes/A/B/C otherwise. I was hoping to be able to tell
| which of the two was appropriate, rather than try one, then the other.
| And yes, I could always try one, then the other.

In other words, Acrobat is returning a malformed OS 9 path, one using slashes instead of colons. Were you using Carbon, this would be straightforward: replace the slashes with colons, then treat it as an OS 9 path. As you're using Java, I don't think there is a solution that isn't a hack.

Indeed, I doubt there's any non-Carbon solution that will work in general, since there is no guarantee that /Volumes holds all the mounted non-boot drives. /Volumes is the conventional directory where drives are mounted, but the FreeBSD underpinnings of OS X permit mounting drives anywhere at all, and there are third-party programs that take advantage of that freedom (not to mention Linux refugees doing such antics from Terminal). You might be able to reconstruct the full list of mounted drives by scanning /dev for disks, but that's just a guess.


| listRoot() does not seem to be what I want/need. It only returns
| "/" - which is not the name of a disk, boot or otherwise.
| (Why did you say that listRoot() returns what I said I needed?)

Because you said what you needed was the system drive, which, in OS X, is always "/". The *name* of the system drive is almost never needed, since it never appears in a valid OS X path. As you gave no details about what you needed the system drive *for*, the most reasonable guess was that you wanted to read or write files on it. On OS X, that's equivalent to reading or writing files in the root directory, and that's what listRoots() returned: the name of the root directory.

Glen Fisher
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >A little help for a Mac newbie? :-) (From: Moises Lejter <email@hidden>)
 >Names of drives (was Re: A little help for a Mac newbie? :-)) (From: Moises Lejter <email@hidden>)



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.