[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: George Beckman <gbeckman@...>
Date: Wed, 22 Nov 2000 17:34:42 -0800
on 11/22/00 5:08 PM, Brian Stevens at brilor@... wrote:

> 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?


Just this thought.  I don't know what you are feeding GetWDRefNum, but
volumeID% is not the VolRefNum that FB uses.  I know you probably know that,
but there has been so much confusion here, I thought I would mention it.  It
is looking for the VolumeID that an alias will provide.  It seems that the
main HD, when I was fighting this was usually -1, but that is not a
dependable number.  Just an example of what it looks like.   Below is the Fn
GetWDRefNum that Rick Brown did for FB II with his comments.  Then below
that is a routine that shows how fsSpec can feed GetWDRefNum the proper
goodies...

_myProcID = _"PGGP"
'-------------------------------------------------
CLEAR LOCAL
DIM iopb.52
DIM OSErr
LOCAL FN GetWDRefNum(volumeID, dirID&,OSErrAddr&)
  'Call as follows:
  '  wdRefNum = FN GetWDRefNum(volumeID, dirID&, @OSErr)
  'Returns a Working Directory Reference Number, given a
  '_true_ volume reference number (volumeID) and a directory
  'ID (dirID&).  The wdRefNum should be used in most places
  'where FB documentation talks about a "volume reference number".
  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%


Here is a snip of code I use that gets the volumeID from and alias and
applies it to the routine via an fsSpec

CLEAR LOCAL
DIM osErr
DIM useAlias
DIM RECORD fsSpec
  DIM fsVrefNum%
  DIM fsParID&
  DIM 63 fsName$
DIM END RECORD .fsSpec

DIM myFSSpec.fsSpec
DIM test
LOCAL FN SeeAboutAQuickOpen
  
  osErr=FN useAlias(1003,myFSSpec)
  LONG IF osErr=0
    'PARENTID=myFSSpec.fsParID&
    gFileVol=FN GetWDRefNum(myFSSpec.fsVrefNum%,myFSSpec.fsParID&,@OSErr)
<snip>

Hope this helps.

-- 
Best Wishes,

George
<mailto: gbeckman@...>
http://www.pggp.com