Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!integral!dhare From: dhare%integral@Sun.COM (Dwight Hare) Newsgroups: comp.sys.mac.programmer Subject: Writing resources to a file Message-ID: <51379@sun.uucp> Date: 29 Apr 88 19:04:48 GMT Sender: news@sun.uucp Reply-To: dhare@sun.UUCP (Dwight Hare) Distribution: na Organization: Sun Microsystems, Mountain View Lines: 17 I am writing resources to files for the first time. The interface for this is extremely clumsy. In short, I do the following: 1) Do a GetFInfo of the file to see if it already exists 2) if it doesn't, do a PBCreate 3) do an openresfile of the file 4) do a Get1Resource of the resource I intend to write 5) if the get fails, allocate a handle and do an AddResource 6) change the resource 7) call ChangedResource with the resource 8) do a CloseResFile. Two questions: Is this right? Do I need to deallocate the handles if I allocated them, and if so, how? (DisposHandle or DisposeResource?) Thanks, Dwight