Path: utzoo!attcan!uunet!husc6!think!ames!amdahl!nsc!voder!apple!lsr From: lsr@Apple.COM (Larry Rosenstein) Newsgroups: comp.sys.mac.programmer Subject: Re: Reading a resource from an already open file Message-ID: <16730@apple.Apple.COM> Date: 7 Sep 88 15:46:29 GMT References: <29389@bbn.COM> Reply-To: lsr@apple.com.UUCP (Larry Rosenstein) Organization: Advanced Technology Group, Apple Computer Lines: 24 In article <29389@bbn.COM> levin@BBN.COM (Joel B Levin) writes: >I would like to read a resource out of the Desktop file. >Unfortunately, under multifinder it is always open and OpenResFile >always returns error -49. (This is not a problem if I do this in an You can open it read-only using OpenRFPerm (Inside Mac volume 4). This is not available on 64K ROM machines, however. The danger is that the Finder will still have the Desktop file open read-write and therefore there are 2 copies of the resource map in memory. If the Finder changes the desktop file (which changes the location of resources on the disk) then your copy of the resource map will be invalid. You can minimize the danger by opening the file only when you need it. Unfortunately the Desktop file can be large and opening it can take a couple of seconds. Larry Rosenstein, Object Specialist Apple Computer, Inc. 20525 Mariani Ave, MS 46-B Cupertino, CA 95014 AppleLink:Rosenstein1 domain:lsr@Apple.COM UUCP:{sun,voder,nsc,decwrl}!apple!lsr