[futurebasic] Re: [FB] Deleting a file after finding with GETCATINFO

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 2000 : Group Archive : Group : All Groups

From: Brian Stevens<brilor@...>
Date: Wed, 22 Nov 2000 18:08:54 -0700
>Hello Brian,
>
>I think you should provide the dirID to GetWDRefNum, I would try this:
>
>DIM iopb.52
>DIM OSErr
>LOCAL FN GetWDRefNum(volumeID%,dirID&,OSErrAddr&)
>   iopb.ioCompletion& = 0
>   iopb.ioNamePtr&    = 0
>   iopb.ioVRefNum%    = volumeID%
>   iopb.ioWDDirID&    = dirID&
>   iopb.ioWDProcID&   = _myProcID
>   OSErr = FN OPENWD(@iopb)
>   POKE WORD OSErrAddr&, OSErr
>END FN = iopb.ioVRefNum%
>
>LOCAL FN FindSomething (pbPtr&, searchStrPtr&)
>   DIM found%
>   DIM @ test%, OSErr%
>
>   found% = _false
>   LONG IF UCASE$(PSTR$(pbPtr&.ioNamePtr&)) = UCASE$(PSTR$(searchStrPtr&))
>     LONG IF pbPtr&.ioFlUsrWds.fdType& = _"TYPE" AND 
>pbPtr&.ioFlUsrWds.fdCreator& = _"CREA"
>       found% = _true
>       test% = FN GetWDRefNum(pbPtr&.ioVRefNum%,pbPtr&.ioDirID&,@OSErr%)
>     END IF
>   END IF
>   INSTR(0,UCASE$(PSTR$(pbPtr&.ioNamePtr&)),UCASE$(PSTR$(searchStrPtr&)))
>END FN = found%
>
>
>NSIH
>
>Cheers
>
>Alain
>
>

I tried it and now I remember my previous results. OSErr returns from 
GetWDRefNum as -43(File Not Found). So, obviously, I'm not giving 
OPENWD the right information to find this file. Any other ideas?

TIA---Brian