[SOLVED] RE: Getting a FSVolumeRefNum from NSString
[SOLVED] RE: Getting a FSVolumeRefNum from NSString
- Subject: [SOLVED] RE: Getting a FSVolumeRefNum from NSString
- From: email@hidden
- Date: Fri, 16 Sep 2005 02:05:42 +0000
Works like a champ. Thanks Bill!
Kris
> > 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:
This email sent to email@hidden