예제 #1
0
파일: FSpCompat.c 프로젝트: zv/metamage_1
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) );
    }
}
예제 #2
0
파일: ftmac.c 프로젝트: dikerex/theqvd
  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;
  }