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?



Rolf Howarth wrote:

>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.


>One thing I'm worried about if I do it myself is whether the "standard"
>directory names are the same in other languages. Will they still be called
>/Users, /Volumes, /System, ~/Library/Preferences etc. if I choose French or
>Japanese as my language when installing Mac OS X?

I'm pretty sure /Volumes is language-independent.  I think most of the
things in / are, but I forget where I read that.

That'd be a good question to ask on an i18n Apple list, though.  If there
were one.  I dunno, maybe someone on Cocoa-dev knows where to look.
  <http://lists.apple.com/mailman/listinfo>

  -- GG


 _______________________________________________
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.