Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!apple!dlyons From: dlyons@Apple.COM (David A. Lyons) Newsgroups: comp.sys.apple2 Subject: Re: GS/OS Close(0) Message-ID: <51129@apple.Apple.COM> Date: 3 Apr 91 16:42:30 GMT References: <51058@apple.Apple.COM> <1991Apr3.025718.5615@nntp-server.caltech.edu> Organization: Apple Computer Inc., Cupertino, CA Lines: 58 In article <1991Apr3.025718.5615@nntp-server.caltech.edu> toddpw@nntp-server.caltech.edu (Todd P. Whitesel) writes: >We want to prevent a Close(0) from closing files that the application didn't >open!! Yes, I understand the problem. I was trying to say that tagging the files according to "who opened them" is the boring part of the problem, whether it's done by GS/OS internally or by a tack-on MultiFinder that intercepts GS/OS calls. The *interesting* part, given that there is no explicit concept of the "current application" (no "GetCurrentOSApp" and "SetCurrentOSApp" calls) is determining on the fly what application to tag a file with. If you're thinking it would call FindHandle on the address the OS call is being made from & check the user ID of that block, then I ask: o What about files opened by the toolbox *on behalf of* an application or DA? o What about files opened by the Loader, ExpressLoad, or GQuit? DAL>The UserID system has plenty of value other than for MF-type switching; DAL>several parts of the *toolbox* are a much bigger barrier barrier to a DAL>MF than GS/OS is. >That's not obvious to me from my readings of the toolbox manual. If anything >the GS toolbox is better designed to make the move to a multi-application >environment than the Mac toolbox was. The real problem is in arbitrating >resource use between applications -- patching the tool locator to use UserID's >uniformly for keeping track of who started what is not too bad, but points out >a fundamental flaw in the toolbox itself -- the UserID is not enforced well >enough and the initial application guidelines left plenty of room for making >program switchers difficult. Every time anybody makes calls to DisposeAll, SetPurgeAll, HLockAll, or HUnlockAll (which operate on all handles owned by a given user ID), the user ID system has value. The Loader and ExpressLoad use some of these. User IDs are also invaluable when doing any debugging, since they let you see what's where. Patching the tool locator to see who started what--do you mean watching for xxxStartUp and xxxShutDown calls and not *really* shutting down a tool until everybody who started it up has shut it down? -- Biggest problem with that is that NDAs traditionally (and rightly) check to see if a tool is already started; if it is, they use it *without* starting it up again. >[...] >Todd Whitesel >toddpw @ tybalt.caltech.edu -- David A. Lyons, Apple Computer, Inc. | DAL Systems Apple II System Software Engineer | P.O. Box 875 America Online: Dave Lyons | Cupertino, CA 95015-0875 GEnie: D.LYONS2 or DAVE.LYONS CompuServe: 72177,3233 Internet/BITNET: dlyons@apple.com UUCP: ...!ames!apple!dlyons My opinions are my own, not Apple's.