简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM