• 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: How to get mount options of a mounted volume?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get mount options of a mounted volume?


  • Subject: Re: How to get mount options of a mounted volume?
  • From: Ken Thomases <email@hidden>
  • Date: Wed, 12 Oct 2011 01:41:51 -0500

On Oct 12, 2011, at 1:12 AM, Oleg Krupnov wrote:

> On Wed, Oct 12, 2011 at 5:51 AM, Ken Thomases <email@hidden> wrote:
>
>> On Oct 11, 2011, at 6:42 AM, Oleg Krupnov wrote:
>>
>>> I'd like to get the mount options of a particular volume (like "rw",
>>> "nobrowse", "automounted" etc.) of a mounted volume, like those I get
>>> when I run "mount" command in the Terminal.
>>
>> There are many ways to get volume information.  For the mount flags, you can look at statfs().
>>
>> It can also be instructive to look at the documentation for the getattrlist() function.  It is basically the swiss army knife of file system APIs.  It's what most of the others are based on.
>>
>> Apple's FSMegaInfo sample is a good tool for exploring the various APIs for querying file system data, although it's getting a bit long in the tooth now, and is missing some of the newer APIs.
>> https://developer.apple.com/library/mac/#samplecode/FSMegaInfo/Introduction/Intro.html
>

> Bingo! The f_flags field of statfs structure. Thanks, Ken.

You're welcome.  I'm glad I could help, although I see that Greg Guerin beat me to it.


> I've also checked FSMegaInfo, but I haven't found any additional ways
> to check the mount flags. It seems to use the same BSD statfs way.

Well, it can exercise getattrlist(), at least.

Also, my point was that some of the information one might be interested in from the mount flags could be available in different forms from the other APIs.  It depends on what you're actually looking for.  And FSMegaInfo is a very convenient tool for see exactly what those other APIs can provide.

Regards,
Ken

_______________________________________________

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: 
 >How to get mount options of a mounted volume? (From: Oleg Krupnov <email@hidden>)
 >Re: How to get mount options of a mounted volume? (From: Ken Thomases <email@hidden>)
 >Re: How to get mount options of a mounted volume? (From: Oleg Krupnov <email@hidden>)

  • Prev by Date: Re: CoreRecipes in Xcode4 ?
  • Next by Date: Re: AVFoundation and kYUVSPixelFormat from AVPlayer
  • Previous by thread: Re: How to get mount options of a mounted volume?
  • Next by thread: "diskutil info -plist" via Cocoa object?
  • Index(es):
    • Date
    • Thread