• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Can these be done in Cocoa?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can these be done in Cocoa?


  • Subject: Re: Can these be done in Cocoa?
  • From: Douglas Davidson <email@hidden>
  • Date: Fri, 4 Jan 2002 09:43:15 -0800

1. In my first column, I'd like to present a list of the volumes currently mounted. I'm able to determine what the UNIX mount points of the volumes are using NSWorkspace's mountedLocalVolumePaths method. I use this to get the icon for each volume using NSWorkspace's iconForFile method, and I assume that the last path portion of each mount point within /Volumes is the name of the volume itself. (As it seems to be for every test case I've come up with thusfar.) However, the boot-up hard drive itself is mounted simply as "/", so my method of determining the volume name does not work in this case. I've searched every relevant Cocoa class I can find, but I don'
t see any methods for returning volume names. Can anyone point me in the right direction?

NSWorkspace currently does not deal in volume names. Also, the name of the mount point need not be the name of the volume. You can use Carbon calls--for example, FSGetVolumeInfo--to obtain the correct volume name. It should be fairly straightforward to go from path to FSRef to volume reference number to volume name, but perhaps someone will be kind enough to post a code sample...if not, I can produce one.

Douglas Davidson


References: 
 >Re: Can these be done in Cocoa? (From: Stéphane Sudre <email@hidden>)

  • Prev by Date: Re: initialFirstResponder
  • Next by Date: Re: The ULTIMATE Cocoa Development Language
  • Previous by thread: Re: Can these be done in Cocoa?
  • Next by thread: Re: Running a regular expression on an NSString
  • Index(es):
    • Date
    • Thread