Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!keith From: keith@Apple.COM (Keith Rollin) Newsgroups: comp.sys.mac.programmer Subject: Re: Memory Protection (was: Gripes) Message-ID: <48672@apple.Apple.COM> Date: 30 Jan 91 22:27:39 GMT References: <1991Jan25.183443.2825@waikato.ac.nz> <1991Jan25.213652.26781@cbnewsk.att.com> <1991Jan29.074646.7218@actrix.gen.nz> Organization: Apple Computer Inc., Cupertino, CA Lines: 47 In article <1991Jan29.074646.7218@actrix.gen.nz> Bruce.Hoult@bbs.actrix.gen.nz writes: > >ned.horvath writes: >>The OS proper is the moral >>equivalent of floor sweepings, and the ugliness of HFS and MultiFinder >>are the result. > >What's so ugly about HFS? I don't see any problems with the programming >interface to it, and it looks to be a pretty good implementation of a >high-performance file system -- the use of a volume allocation bitmap, and >file extent and directory b*-trees in particular enable much better >performance than the schemes in many other operating system (such as >MS-DOS and Unix, for example). I think that a lot of people don't like HFS because they are confused about the roles working directories and default directories play. They see these things documented in Inside Mac, and think they have to use them. To make my own life simple, I follow these simple rules: - DON'T USE WORKING DIRECTORIES. They're simply not needed. However, as with any general rule, there are two minor exceptions. If you make a Standard File call, you will recieve a WD refnum. Immediately call GetWDInfo and turn this into a real vRefNum/dirID pair. The second exception is when you are sublaunching another application. You need to create a WDRefNum for the application you launch. - DON'T USE DEFAULT DIRECTORIES. Ever since 1986, you've been able to fully specify a file in whatever File Manager or Resource Manager call you are interested in making. The only exception to this is, again, when you are sublaunching another application. You need to do a SetVol() with a WDRefnum so that the launched application can to a GetVol() and find out where it is. When I follow those rules, I rarely run into problems (the only other problems involve wondering if I should put a colon after a string when I want to refer to a directory, or what is returned in the various "parID" fields on GetCatInfo and GetFInfo calls). I never sub-launch other programs, so the only time I have to deal with working directories is when I make a Standard File call...and I don't deal with them for long because I immediately get the real vRefNum and dirID. -- ------------------------------------------------------------------------------ Keith Rollin --- Apple Computer, Inc. --- Developer Technical Support INTERNET: keith@apple.com UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith "Argue for your Apple, and sure enough, it's yours" - Keith Rollin, Contusions