Re: Mount Point
Re: Mount Point
- Subject: Re: Mount Point
- From: "Herb Petschauer" <email@hidden>
- Date: Wed, 28 May 2008 14:31:52 -0700
2008/5/28 Mr. Gecko <email@hidden>:
> 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?
You can get the mount point from a device name (bsd name) by using
getmntinfo(), iterate the mount points and compare the statfs's
f_mntfromname field to your bsd name (i.e. match your device name).
On a match, copy the mount point from the f_mntonname field.
This advice has no warranties, do thoroughly read the getmntinfo man page.
You can always roll your own Objective-C version...
Cheers,
-H.
_______________________________________________
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>) |