+ VolumeParam vp;
+ FSSpec fspec;
+ Str255 name;
+ char *c;
+
+ // first, get the volume reference number for the file. Start by
+ // making a Pstring with just the volume name
+ strcpy ((char *) name, path);
+ if (c = strchr ((char *) name, ':'))
+ {
+ c++;
+ *c = '\0';
+ }
+
+ c2pstr ((char *) name);
+ vp.ioCompletion = 0;
+ vp.ioVolIndex = -1;
+ vp.ioNamePtr = name;
+ vp.ioVRefNum = 0;
+
+ if (PBGetVInfo((ParamBlockRec *)&vp, 0) != noErr)
+ return 0;
+
+ // next, buld an FSSpec for the file
+ strcpy ((char *) name, path);
+ c2pstr ((char *) name);
+ if (FSMakeFSSpec (vp.ioVRefNum, 0, name, &fspec) != noErr)
+ return 0;
+
+ short frefnum;
+ // now open the file, and return it's reference number
+ if (FSpOpenDF(&fspec, fsRdPerm, &frefnum) != noErr)
+ return 0;
+
+ return frefnum;