Path: utzoo!utgpu!water!watmath!clyde!burl!codas!killer!academ!uhnix1!sugar!peter From: peter@sugar.UUCP (Peter da Silva) Newsgroups: comp.sys.amiga Subject: Re: How to cd Message-ID: <1260@sugar.UUCP> Date: 15 Dec 87 12:24:46 GMT References: <796@rocky.STANFORD.EDU> <1237@sugar.UUCP> <810@rocky.STANFORD.EDU> Organization: Sugar Land UNIX - Houston, TX Lines: 20 In article <810@rocky.STANFORD.EDU>, ali@rocky.STANFORD.EDU (Ali Ozer) writes: > I'm not, because I do not want to connect back to my old directory! OK, that makes more sense now. > I got one message indicating that it seems to be OK to do an UnLock() > on my ORIGINAL directory --- the one returned by CurrentDir(). In short: > > destdir = Lock ("whatever the new directory is", ACCESS_READ); > UnLock (CurrentDir (destdir)); > /*Error conditions, checks, etc, deleted for brevity*/ This looks good to me. You're leaving exactly one directory lock open, which is the right thing to do. There was one lock open at the start (your original directory) and one at the end (the new current directory). All balances. If you close destdir, the first time you try to access your current directory you'll have an invalid lock. This is likely to guru you. -- -- Peter da Silva `-_-' ...!hoptoad!academ!uhnix1!sugar!peter -- Disclaimer: These U aren't mere opinions... these are *values*.