• 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
How to discover the volume id to use in a File Reference URL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to discover the volume id to use in a File Reference URL


  • Subject: How to discover the volume id to use in a File Reference URL
  • From: Ben Staveley-Taylor <email@hidden>
  • Date: Mon, 23 Sep 2013 17:14:13 +0100

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 (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


  • Follow-Ups:
    • Re: How to discover the volume id to use in a File Reference URL
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: Cocoa-dev Digest, Vol 10, Issue 602
  • Next by Date: How is one supposed to use a UIPageViewController in a storyboard?
  • Previous by thread: Re: Developer Site Safari PlugIn
  • Next by thread: Re: How to discover the volume id to use in a File Reference URL
  • Index(es):
    • Date
    • Thread