Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!well!svc From: svc@well.UUCP (Leonard Rosenthol) Newsgroups: comp.sys.mac.programmer Subject: Re: Standard File and Desk Accessories Summary: Need to write resources... Message-ID: <12074@well.UUCP> Date: 8 Jun 89 16:52:55 GMT References: <50967@tut.cis.ohio-state.edu> <7547@hoptoad.uucp> <4972@umd5.umd.edu> <2015@husc6.harvard.edu> Lines: 51 In article <2015@husc6.harvard.edu>, siegel@endor.harvard.edu (Rich Siegel) writes: > In article <51276@tut.cis.ohio-state.edu> Todd A Hitt writes: > > [adding a resource (!!) to a resource file to hold storage] > > Yeeeech. I would throw away any program that added resources > to a running application without my explicit command. The idea of adding > a resource in this manner has some big holes in it: > I agree that adding a resource FOR THIS reason is VERY bad and I agree that it using resources 'freely' for this type of purpose is not always the way to go - BUT there are VERY good reason to add resources to a file WITHOUT user intervention. One of the best reason that I know of, and that both MPW and MicroPhone II v3.0 do, is autosaving of window sizes/positions. Since the user could reposition/resize his windows WITHOUT changing any settings/text you must STILL retain that window change and the best way that I have found to do that is to simply add a resource to the datafile when it is closed which contains the window info. > 1. The file is modified. > 1a. Doing so changes the mod date, which means that > the next time I do an incremental backup, > the file has to get backed up for no particularly > good reason. > I agree that this does change that mod date, but you HAVE changed the file if you HAVE moved windows. If the mod date problem you felt strongly about you COULD get the curModDate, make the resChange, and then reset the date. > 1b. Doing so will set of virus detectors left and right. > Maybe. We have not found any that get upset about it yet... > 2. What if the AddResource fails, perhaps because the disk is > write-protected or full? If that happens, you're hosed. > For the original concept, yes you are - but for saving window pos it just means that user doesn't get his positions saved. You could, of course, alert the user to the situation just like you do when you try to do ANY write. > 3. As I said, modifying applications without explicit command > is repugnant to me. > I, again, ask you to reconsider - though I AGREE that APPLICATION modification is A LOT worse then datafile mods. -- +--------------------------------------------------+ Leonard Rosenthol | GEnie : MACgician Lazerware, inc. | MacNet: MACgician UUCP: svc@well.UUCP | ALink : D0025