Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!apple!keith From: keith@Apple.COM (Keith Rollin) Newsgroups: comp.sys.mac.programmer Subject: Re: Standard File and Working directories... Message-ID: <54370@apple.Apple.COM> Date: 27 Jun 91 02:06:49 GMT References: <1991Jun26.084825.9019@dartvax.dartmouth.edu> Organization: Apple Computer Inc., Cupertino, CA Lines: 45 In article <1991Jun26.084825.9019@dartvax.dartmouth.edu> llama@eleazar.dartmouth.edu (Joe Francis) writes: >chuck@brain.UUCP (Chuck Shotton) writes: > >>Given the raft of Tech Notes on the subject, and the general noise concerning >>them, I get the impression that Working Directories have fallen from grace. >>Do they serve a purpose anymore? Why would I ever use one? (This IS a serious >>question.) > >In answer to why would you ever use one... > >Before there were the new high level file manager calls (doc'd in a tech >note, then put in IM VI), the only way I know of to take a Volume Name, >Dir ID, and File Name and manage to open that file is to open a working >directory. I would LOVE to be proven wrong on this, so please post any >alternatives (given the above assumptions). You could open a file with PBHOpen. QED. Some people don't like using the low-level calls, but once you start using them, you find that they aren't that bad. I often prefer using them over the high level calls. >They high level HFS call HOpen, (TN 218, IM VI) takes a Dir ID directly. >The tech note indicates that the call is provided in glue for MPW 3.0+, >so presumeably it will work with any HFS system. > >What I want to know is: does this call result in working directories >being opened behind the scenes? If so, are they disposed of properly? No, they don't create working directories. There are only two reasons for creating working directories: - If you are launching another application that expects to find its location by making a GetVol call. - If you are writing a hack that involves part of the system that still uses working directories. For example, one person was patching StdFile and needed to create WD's. Another person wanted to fake out INIT 31 and needed to create WD's. -- ------------------------------------------------------------------------------ Keith Rollin --- Apple Computer, Inc. INTERNET: keith@apple.com UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith "But where the senses fail us, reason must step in." - Galileo