This article is from the Mac Programming FAQ, by Jon Watte email@example.com with numerous contributions by others.
You call (surprise!) PBGetCatInfo! Make ioNamePtr point to an empty
string (but NOT NULL) of length 63 (like, an Str63) and ioFDirIndex
negative (-1 is a given winner) - this makes PBGetCatInfo return
information about the vRefNum/dirID folder instead of the file/folder
specified by vRefNum, parID and name.