Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!sun-barr!apple!Apple.COM!lsr From: lsr@Apple.COM (Larry Rosenstein) Newsgroups: comp.sys.mac.programmer Subject: Re: file system calls and resource file calls Message-ID: <2007@internal.Apple.COM> Date: 22 May 89 20:38:47 GMT References: <24103@shemp.CS.UCLA.EDU> Sender: usenet@Apple.COM Organization: Objects-R-Us, Apple Computer, Inc. Lines: 25 In article <24103@shemp.CS.UCLA.EDU> korfhage@lanai.cs.ucla.edu writes: > However, I use SFPutFile to get the file name, and that gives me a name and > a directory reference. When I open up the file to write in the CEKI > resource, the call (e.g. CreateResFile) wants an absolute pathname, and > not a name-and-directory-reference. The easiest thing to do is to call SetVol to set the current directory to the one returned by Std File, and then use the filename in the CreateResFile call. (You may want to precede this by a call to GetVol to save the old current directory.) You will also want to consult Tech Notes 101 & 214. 101 explains that you should call the Create function first, to create the file, before calling CreateResFile. The reason is that CreateResFile tries to open the resource file first, but because of the Poor Man's Search Path it may find a file with the same name in the System Folder. Tech Note 214 describes new MPW glue routines that do this stuff for you. Larry Rosenstein, Apple Computer, Inc. Object Specialist Internet: lsr@Apple.com UUCP: {nsc, sun}!apple!lsr AppleLink: Rosenstein1