Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!mailrus!cornell!biar!trebor From: trebor@biar.UUCP (Robert J Woodhead) Newsgroups: comp.sys.mac.programmer Subject: Resource Weirdness Keywords: Resource Weird Files Message-ID: <664@biar.UUCP> Date: 20 Jun 89 21:47:30 GMT Organization: Biar Games, Inc. Lines: 44 I'm trying to do some pretty standard resource operations and getting the strangest results. Basically, what I am trying to do is save a document's data in two parts, normal ``text'' that any other app can read, and a resource that gives my app extra information. I already know of the problems the Poor Man's Search Path creates with OpenResFile, but my results are bizzare. Here is what I am doing : standard SF dialog to get filename and WDRefnum GetVol to get current volume or working directory SetVol to the WDRefnum Delete to trash any existing version of the file Create Open Write the text Close CreateResFile to create the resource fork OpenRFPerm to get it open (with StripAddress too!) UseResFile because I'm paranoid AddResource CloseResFile SetVol back to original volume UseResFile back to my app's resource file. Now get a load of what is happening: The file gets created in the right folder. The data fork gets written correctly. The resource fork gets _created_. The new resource goes in my app's resource fork, and is of semi-random length. I've had ResEdit tell me the resource is several megabytes long! This may be a no-brainer (gawd, I hope it _is_!), but I would greatly appreciate help on this one. -- (^;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-;^) Robert J Woodhead, Biar Games, Inc. !uunet!biar!trebor | trebor@biar.UUCP ``I can read your mind - right now, you're thinking I'm full of it...''