If spec refers to a file that does NOT exist, but the parent
directory (spec->parID) DOES exist, should this work?
OSErr FSpGetParent(FSSpec* spec)
{
CInfoPBRec pb;
DirInfo* dirRec = (DirInfo*)&pb;
OSErr err;
Str255 s;
PStrCopy(spec->name, s);
dirRec->ioCompletion = nil;
dirRec->ioNamePtr = s;
dirRec->ioVRefNum = spec->vRefNum;
dirRec->ioFDirIndex = -1;
dirRec->ioDrDirID = spec->parID;
err = PBGetCatInfoSync(&pb);
if(err == noErr)
err = FSMakeFSSpec(dirRec->ioVRefNum, dirRec->ioDrParID, s, spec);
return err;
}
Should err returned from PBGetcatInfoSync be noErr or fnfErr, and
should ioDrParID contain the parent directory upon completion?