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

2013-09-25 Thread Ben Staveley-Taylor
I did an informal time test on the path resolution using NSURL with a known ID, like this: NSURL *itemRefUrl = [NSURL URLWithString:@"file:///.file/id=1234.5678/"]; NSString *itemPath = [[itemRefUrl filePathURL] path]; I realise now that creating a file reference URL from a lite

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

2013-09-24 Thread Ken Thomases
On Sep 24, 2013, at 11:41 AM, Charles Srstka wrote: > On Sep 24, 2013, at 3:54 AM, Ken Thomases wrote: > >> I believe one solution is the searchfs() routine. Of course, that's a >> potentially slow or expensive operation. In theory, I suppose, searching >> for a file by its ID should be no s

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

2013-09-24 Thread Charles Srstka
On Sep 24, 2013, at 5:05 PM, Ken Thomases wrote: >> Because if you had to do an entire drive search for every ancestor, that >> would quite likely take a *long* time to complete. > > I don't think that searchfs() _necessarily_ does a true full-drive search. > Given a unique file ID (ATTR_CMN_

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

2013-09-24 Thread Ken Thomases
On Sep 24, 2013, at 4:55 PM, Charles Srstka wrote: > On Sep 24, 2013, at 4:47 PM, Ken Thomases wrote: > >> I was not aware of those limitations. Thanks for enlightening me. It >> looks, though, like you could reconstruct a path by working your way back >> from the item through its ancestors,

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

2013-09-24 Thread Charles Srstka
On Sep 24, 2013, at 4:47 PM, Ken Thomases wrote: > I was not aware of those limitations. Thanks for enlightening me. It looks, > though, like you could reconstruct a path by working your way back from the > item through its ancestors, getting each name along the way, using > ATTR_CMN_NAME an

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

2013-09-24 Thread Charles Srstka
On Sep 24, 2013, at 3:54 AM, Ken Thomases wrote: > I believe one solution is the searchfs() routine. Of course, that's a > potentially slow or expensive operation. In theory, I suppose, searching for > a file by its ID should be no slower than converting a file reference URL to > a file path

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

2013-09-24 Thread Ben Staveley-Taylor
You're right, I should really be storing bookmark data, but I am working on the Mac side of a cross-platfrom product and the full bookmark information is not available to me without a lot of invasive work. searchfs() sounds like what I need. Thanks very much for the advice. -- Ben. On 24 Sep

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

2013-09-24 Thread Ken Thomases
On Sep 24, 2013, at 3:24 AM, Ben Staveley-Taylor wrote: > The reason I want to do this is to discover the textual path of a file given > its file ID (and a volume name). > So I suppose my real question is how to find the path for a file by its id > (its fileSystemFileNumber attribute). How is

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

2013-09-24 Thread Ben Staveley-Taylor
Thanks, Ken. The reason I want to do this is to discover the textual path of a file given its file ID (and a volume name). The only way I could come up with to do this was to create a file reference NSURL and then convert it to a file path URL with [NSURL filePathURL]. If there is a better way

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

2013-09-24 Thread Ken Thomases
On Sep 23, 2013, at 11:14 AM, Ben Staveley-Taylor wrote: > 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=./ > e.g. file:///.

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

2013-09-24 Thread Ben Staveley-Taylor
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=./ e.g. file:///.file/id=6571367.2773272/ I want to compose a reference URL for a file