pascal OSErr FSpOpenRFCompat(const FSSpec *spec, char permission, short *refNum) { #if !__MACOSSEVENORLATER if ( !FSHasFSSpecCalls() && !QTHasFSSpecCalls() ) { OSErr result; HParamBlockRec pb; pb.ioParam.ioVRefNum = spec->vRefNum; pb.fileParam.ioDirID = spec->parID; pb.ioParam.ioNamePtr = (StringPtr) &(spec->name); pb.ioParam.ioVersNum = 0; pb.ioParam.ioPermssn = permission; pb.ioParam.ioMisc = NULL; result = PBHOpenRFSync(&pb); *refNum = pb.ioParam.ioRefNum; return ( result ); } else #endif /* !__MACOSSEVENORLATER */ { return ( FSpOpenRF(spec, permission, refNum) ); } }
static long ResourceForkSize(FSSpec* spec) { long len; short refNum; OSErr e; e = FSpOpenRF( spec, fsRdPerm, &refNum ); /* I.M. Files 2-155 */ if ( e == noErr ) { e = GetEOF( refNum, &len ); FSClose( refNum ); } return ( e == noErr ) ? len : 0; }