Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!umich!ox.com!heifetz!tbomb!time From: time@ice.com (Tim Endres) Newsgroups: comp.sys.mac.programmer Subject: Re: Yikes: Using both resource & data forks of a file Message-ID: <0B01FFFF.dbbnhif@tbomb.ice.com> Date: 17 Apr 91 02:30:32 GMT Reply-To: time@ice.com Organization: ICE Engineering, Inc. Lines: 24 X-Mailer: uAccess - Mac Release: 1.1.b1 In article <280B842C.16551@orion.oac.uci.edu>, bdugan@teri.bio.uci.edu (Bill Dugan) writes: > I'm creating a document file with "Create", writing data to the file's > data fork, and closing the file. Everything's great. But then I > want to put some resources in the file. I am trying "OpenRFPerm" with > write permission enabled, and it doesn't work; calling ResError() reveals > an EOF, which leads me to believe there's no resource fork, despite > IM's claim that Create will set up both forks of the file created. IM is correct, but misleading. When you use Creat(), you are indeed creating the *catalog* entries for both forks of the file. In fact, I have verified this looking at the catalog for a new file. HOWEVER, since the resource fork is initially empty, there is not even a resource map for OpenRFPerm() to load, thus the EOF error. You must, therefore, create the map (and other needed space) in the resource fork with a CreateResFile() call. This is *certainly* not obvious from IM. tim. ------------------------------------------------------------- Tim Endres | time@ice.com ICE Engineering | uupsi!ice.com!time 8840 Main Street | Voice FAX Whitmore Lake MI. 48189 | (313) 449 8288 (313) 449 9208