Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!ucbvax!agate!apple!oliveb!amdahl!rtech!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Config File Resource Blues Message-ID: <7930@hoptoad.uucp> Date: 10 Jul 89 21:41:44 GMT References: <2013@dogie.macc.wisc.edu> <1165@intercon.UUCP> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 29 In article <1165@intercon.UUCP> amanda@intercon.uu.net (Amanda Walker) writes: >write_settings: > CreateResFile (if it's not already there) > OpenResFile // open the settings file > if (GetResource) // if there's an old setting resource, > RmveResource // remove it > AddResource // add the current settings as a resource > CloseResFile // close the settings file Amanda, this is exactly the approach Ross Yahnke described in his message! What are you contributing by reading it right back to him? As I pointed out, this approach is terribly inefficient in terms of memory usage, since the whole resource map is getting resized and reshuffled twice. >As another trick, you can put a default settings resource in >your application, so that you don't have to worry about the settings file >not being there the first time. Except that if you do this using your pseudocode, the default settings resource in the application file will be removed. Do I have to explain why it's a no-no to write to your application file? -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com Postal: 424 Tehama, SF CA 94103; Phone: (415) 495-2934 "The time is gone, the song is over. Thought I'd something more to say." - Roger Waters, Time