Date: Thu, 19 Nov 1998 00:16:49 -0500 To: futurebasic@..., allmedia@... From: "Eric M. Bennett" <ericb@...> Subject: working directories, vrefs, and paramblocks explained [long] (was Re: [FB] C to FB) Message-Id: <v04003000b2793da069a2@[128.253.200.125]> Sylvain wrote: snip In theory, the following function will do what you want (it's modified from some other code of mine, and I haven't tested my modifications). If you want to understand how it works (and a good programmer always understands how the code he's using works :-), then you'll have to read the rest of this rather long message. 'this function converts a path name to a 'working directory number ' 'Note the total lack of error checking. ' CLEAR LOCAL DIM 255 paramblock$,pbPtr&,oserr%,workingDirectoryNumber% LOCAL FN NameToID (fold$,myAppCreatorCode&) 'fold$ holds a full pathname pbPtr&=@paramblock$ 'Get address of this block of memory... pbPtr&.ioCompletion&=0 '...and access it as a record. pbPtr&.ioNamePtr&=@fold$ 'A pointer to the pathname of a directory. pbPtr&.ioVRefNum%=0 'A volume reference number. oserr%=FN GETCATINFO (pbPtr&) pbPtr&.ioWDProcID& = myAppCreatorCode& oserr%=FN OPENWD (pbPtr&) workingDirectoryNumber%=pbPtr&.ioVRefNum% 'you could call CLOSEWD when you're done using this directory, but 'as I explained previously, that can be dangerous END FN=workingDirectoryNumber% Now for the explanation of how this works. snip Thank yoou, Eric, for a very enlightning dissertation. I will spend a lot of time studying it. Stewart