views:

19

answers:

2

Given an FSRef of a directory, one can use FSGetCatalogInfo to find the volume reference number and the directory ID. Together, these two numbers should be enough to identify the directory. One way to go the other direction would be use FSMakeFSSpec( vRefNum, dirID, "\p", &fileSpec ) and then FSpMakeFSRef( &fileSpec, &dirRef ). However, FSMakeFSSpec and FSpMakeFSRef are deprecated. I'm wondering whether there is a way to go from vRefNum and dirID to FSRef using functions that are not deprecated.

A: 

I've never used it, but it seems FSResolveNodeID may do what you want. Apple pretty much scrubbed its ADC site clean of everything Carbon so I can't find a link to it. But you can look it up in Files.h. Also, it's only available in 10.5 or later.

Stephen Chu
You're right, it's undocumented except for header comments. Too bad it requires 10.5, since `FSMakeFSSpec` was deprecated in 10.4.
JWWalker
A: 

"Apple pretty much scrubbed its ADC site clean of everything Carbon so I can't find a link to it." Nope, see http://developer.apple.com/legacy/mac/library/

Yuhong Bao
That should have been a comment, not an answer.
JWWalker