[futurebasic] C to FB

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

From: Sylvain Guillemette <allmedia@...>
Date: Tue, 17 Nov 1998 22:43:04 -0500
I asked Frederic Rinaldi to help me about converting
a pathname to a VRefNum, and he sent me the following code.

I know as much about C as i know about women :8)

Would someone give it a try ? (i'm on my knees now...)
I'd really appreciate, coz i absolutely need this function.

Thanks.

Sylvain
--------------------------------------------------
FUNCTION GetVolRefNum (PathName : str255; VAR VRefNum : integer) : OSErr;

 (* given a path name of volume name, returns its VRefNum *)

 VAR
  ThePBRec  : paramBlockRec;
  TheErr   : OSErr;

 BEGIN
  IF POS(':',PathName) = 0
  THEN  PathName := CONCAT(PathName,':');

  WITH ThePBRec DO
  BEGIN
   ioVolIndex := -1;
   ioVRefNum := 0;
   ionamePtr := @PathName;
  END;

  TheErr := PBGetVInfoSync(@ThePBRec);

  VRefNum := ThePBRec.ioVRefNum;

  GetVolRefNum := TheErr;
 END; {GetVolRefNum}
--------------------------------------------------