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: Finding startup volume name?



>Is there a simple way to find the startup volume name? I can think of a
couple of ways using Runtime.exec(): do "ls -l /Volumes" and see what links
to /,

Or get a File.listFiles() of /Volumes in Java and call getCanonicalPath() on each File (optional: in a filter object). The one that resolves to "/" is the startup volume, and you can then use the uncanonical path (i.e. the pathname of the symlink) as desired.

This won't work before 10.4, which I think is when the "symlink to startup
volume" first appeared.  Or maybe it was 10.3.  Anyway, if nothing
canonicalizes to "/", I think you're stuck, if the pathname problem is that
serious.

Thanks for the suggestion. This was actually a red herring, I don't need the startup volume name after all. The problem is that QuickTime wants a URL of the form file://Users/rolf/file.mov rather than file:///Users/rolf/..


I think three slashes in the URL is correct (if you're omitting the host name) but QuickTime doesn't like that. I must have lost one in the process of prepending the volume name and that's what suddenly made it work.

-Rolf
--
Rolf Howarth
Square Box Systems Ltd
Stratford-upon-Avon UK.
http://www.squarebox.co.uk
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to 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.