• 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: Mount Point
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mount Point


  • Subject: Re: Mount Point
  • From: Michael Watson <email@hidden>
  • Date: Wed, 28 May 2008 17:41:01 -0400

Now you're depedent on shell output and running three separate processes (plus invoking pipes and regexes). If you look at the source for the mount utility, you'll find that it gets a list of mounted volumes with the getmntinfo() function and then iterates over the statfs structs to print information. You could very quickly and easily dump the list of volumes with getmntinfo() and iterate over the found items until you encounter the entry for the device node you want. Then you can pull whatever info you want out of the statfs struct you found.


-- m-s


On 28 May, 2008, at 17:20, Dmitri Goutnik wrote:

On May 28, 2008, at 10:36 PM, Mr. Gecko wrote:

Hello I have a program that finds a device by it's device number such as /dev/disk2s3 how would I find out the mount point/name of that device?
If not how can I find the device number and name from a mount point?


mount | grep /dev/disk2s3 | sed 's/.* on \(.*\) (.*/\1/'

- Dmitri

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
@bungie.org


This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Mount Point (From: "Mr. Gecko" <email@hidden>)
 >Re: Mount Point (From: Dmitri Goutnik <email@hidden>)

  • Prev by Date: Re: Mount Point
  • Next by Date: DO woes
  • Previous by thread: Re: Mount Point
  • Next by thread: Re: Mount Point
  • Index(es):
    • Date
    • Thread