Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find an FSRef from a directory ID and a volume number?

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.

like image 863
JWWalker Avatar asked Jan 23 '26 03:01

JWWalker


1 Answers

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.

like image 112
Stephen Chu Avatar answered Jan 25 '26 22:01

Stephen Chu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!