home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pmafire!news.dell.com!swrinde!elroy.jpl.nasa.gov!ames!data.nas.nasa.gov!taligent!keith@taligent.com
- From: keith@taligent.com (Keith Rollin)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: Beginner's question on StandardPutFile
- Message-ID: <Btwx5n.7L1@taligent.com>
- Date: 1 Sep 92 18:39:23 GMT
- References: <ewu1.715348919@husc8>
- Sender: usenet@taligent.com (More Bytes Than You Can Read)
- Organization: Taligent
- Lines: 29
-
- In article <ewu1.715348919@husc8>, ewu1@husc8.harvard.edu (Elwin Wu) writes:
- >
- > I'm having trouble getting the volume reference number returned by the
- > StandardPutFile routine. I want to use SetVol and my code typically
- > looks something like this (I'm using Think C 5.0):
- >
- > StandardPutFile(prompt,defaultName,&theReply);
- > SetVol(theReply.sfFile.vRefNum);
- >
- > Should I use something other that SetVol??? Any help would be
- > appreciated. Thanks
-
- IMHO, you should replace the line containing SetVol with a blank line.
- "theReply.sfFile" contains everything you need to access the file. If you want
- to open the data for, call FSpOpenDF. If you want to open the resource fork,
- call FSpOpenResFile. You don't need to change the default directory.
-
- If, for some arcane reason, you feel you _do_ need to change the default
- directory, do it thusly:
-
- GetVol(nil, &oldVol);
- HSetVol(nil, theReply.sfFile.vRefNum, theReply.sfFile.parID);
- DoMyStuff();
- SetVol(nil, oldVol);
-
- --
- Keith Rollin
- Phantom Programmer
- Taligent, Inc.
-