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