Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!apple!keith From: keith@Apple.COM (Keith Rollin) Newsgroups: comp.sys.mac.programmer Subject: Re: Volume Name + dirID == ? Message-ID: <53899@apple.Apple.COM> Date: 12 Jun 91 00:58:00 GMT References: <1991Jun11.195057.20315@ima.isc.com> Distribution: usa Organization: Apple Computer Inc., Cupertino, CA Lines: 30 In article <1991Jun11.195057.20315@ima.isc.com> janee@ima.isc.com (Jane Eisenstein) writes: > >I've been following the discussion on how to obtain permanent file >references. I now know how to obtain the file's volume name and >and directory ID. How do I use them to open the file? In particular, >how do I use them to open a file on an unmounted volume whose absolute >pathname is > 255 characters long? Most often, one gets a reference to a file through StandardFile. Under 6.0.x, you get a vRefNum (which is really a working directory ID) and a file name. You can turn the WD into a real vRefNum and dirID by calling GetWDInfo. Under 7.0, you can make the Standard File call that already returns a real vRefNum and dirID. To get the name of a volume if you have its vRefNum, call GetVInfo with the vRefNum and a pointer to a string buffer. To turn the name back into a vRefNum later, you should be able to make another GetVInfo call. To access the file once you have the vRefNum and dirID again, simply stuff those values into the right parameters of whatever call you need to make. For instance, HOpen explicitly takes a vRefNum, dirID, and file name as parameters. The length of the absolute pathname is irrelevant, as you never need to generate it. -- ------------------------------------------------------------------------------ Keith Rollin --- Apple Computer, Inc. INTERNET: keith@apple.com UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith "But where the senses fail us, reason must step in." - Galileo