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: Getting a FSVolumeRefNum from NSString



get the path from the user, an NSString, and then I need to use that to derrive the FSVolumeRefNum. I know how to get an FSRef, but not the FSVolumeRefNum. Am I missing some simple conversion? Any ideas?

One more step and you're there:

OSStatus err;
FSRef ref;
err = FSPathMakeRef ( [aVolumePath fileSystemRepresentation], &ref, NULL );
if ( noErr == err ) {


    FSCatalogInfo   catalogInfo;
    err = FSGetCatalogInfo ( &ref,
                              kFSCatInfoVolume,
                              &catalogInfo,
                              NULL,
                              NULL,
                              NULL
                              );
    if ( noErr == err ) {

        FSVolumeRefNum thisVolumeRefNum = catalogInfo.volume;
    }
}

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-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.