Does anyone know how to get the volume ID number to use in a reference URL?

I am working with file reference URLs as returned by - (NSURL 
*)fileReferenceURL. These have this textual form:

  file:///.file/id=<volume_id>.<file_id>/
  e.g. file:///.file/id=6571367.2773272/

I want to compose a reference URL for a file whose file_id I know. I know the 
textual path of the volume it is on (e.g "/Volumes/Bob"). I can't figure out 
how to get the volume ID to use from the volume name or path

So far I have tried

        NSURL *vol = [NSURL urlWithString:@"/Volumes/Bob"];     
        id volId;

        [vol getResourceValue:&volId
                forKey: NSURLVolumeIdentifierKey
                error:&err];

But can't see how to use the opaque volId object result;

Also I have tried FSGetCatalogInfo, even though it is deprecated, and using the 
FSVolumeRefNum or nodeID fields, but these don't give me the number I need 
either.

Thanks,

Ben Staveley-Taylor


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to