Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pasteur!ucbvax!decwrl!pyramid!voder!apple!darin From: darin@Apple.COM (Darin Adler) Newsgroups: comp.sys.mac.programmer Subject: Re: Opening Working Directories Message-ID: <8316@apple.Apple.Com> Date: 15 Apr 88 07:35:07 GMT References: <1988Apr13.115044.1591@mntgfx.mentor.com> Reply-To: darin@apple.UUCP (Darin Adler) Organization: Apple Lines: 12 Keywords: vrefnum, directory, working In article <1988Apr13.115044.1591@mntgfx.mentor.com> tomc@mntgfx.mentor.com (Tom Carstensen) writes: > I can't just go closing that last one I opened, it may > have a file in it that I opened. Once you have opened a file, the working directory no longer needs to be open. HFS extracts the volume and directory information from the WDRefNum when the Open call is made. You should always open working directories for as short a time as possible, closing them after using them. As a matter of fact, you can avoid opening working directories at all by using the PBH calls, which take vRefNums and dirIDs to specify the directory and volume a file is in. -- Darin Adler, Apple Computer AppleLink:Adler4 UUCP: {sun,voder,nsc,mtxinu,dual}!apple!darin CSNET: darin@Apple.com