Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!sun-barr!apple!apple.com!nmday From: nmday@apple.com (Neil) Newsgroups: comp.sys.mac.programmer Subject: Re: Journaling Device Drivers Message-ID: <9926@goofy.Apple.COM> Date: 24 Aug 90 17:48:13 GMT References: <9109@uhccux.uhcc.Hawaii.Edu> Sender: usenet@Apple.COM Organization: Apple Computer, Inc. Lines: 33 In article <9109@uhccux.uhcc.Hawaii.Edu> rabanes@uhccux.uhcc.Hawaii.Edu (Greg Rabanes) writes: > 1) When creating the file from within the driver's "open" > routine I am using the File manager routine "create" (NOTE: > the lower case version included in the MPW C header file > ). My code goes as follows: > > char fname[255] = "dezaley:user:journal4.dat"; > > create(fname, vrefnum, fcreator, ftype); > > Now the problem. A file is being created but not with the > name or the directory I specified. I get a file named some- > thing like &*&%&$^%@#% on the default volume. One possible source of error is that the toolbox expects a Pascal string. your declaration should read : char fname[255] = "\pdezaley:user:journal4.dat"; Also, I've encountered cases where MPW dosen't like references to char arrays of the form Somecall(fname) where fname is declared as above. Even though it's kinda' ugly, Somecall (&fname[0]) seems safer. If you're going to be creating files that stick around it's generally better to use a SFPutFile, rather than hard-wiring it into your code. Another alternative is to put your journal files into the blessed folder - See Tech Notes #67 and #129 for an in depth discussion... Neil Day Apple Computer, Inc. Electronic Media Group The oppinions presented above are my own - any resemblance to those of Apple Computer are purely coincidental.