Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!eru!luth!sunic!tut!santra!tko-sony-15.hut.fi!justus From: justus@tko-sony-15.hut.fi (Juhana R{s{nen) Newsgroups: comp.sys.amiga.tech Subject: Re: CurrentDir Message-ID: <1990Mar21.082549.9252@santra.uucp> Date: 21 Mar 90 08:25:49 GMT References: <00173.AA00173@starsoft.UUCP> <133060@sun.Eng.Sun.COM> <1332@quintus.UUCP> Sender: news@santra.uucp (Cnews - USENET news system) Reply-To: justus@niksula.hut.fi (Juhana R{s{nen) Organization: Helsinki University of Technology, Finland Lines: 18 In article <1332@quintus.UUCP> pds@quintus.UUCP (Peter Schachte) writes: >In article <133060@sun.Eng.Sun.COM> cmcmanis@sun.UUCP (Chuck McManis) writes: >> You are forbidden from freeing locks that you didn't create. > >But this leaves the question: how do you write a program that leaves a >different directory current when it exits? Is there a way not to waste >the few bytes occupied by the old lock? How would you write CD? I did... I wrote a CD replacement that combines CD and unix pushd/popd commands. I simply free the lock I got from CurrentDir, no matter what the wise men say. The program works fine, doesn't crash, doesn't junk memory, the only problem is that I wrote it as I shouldn't have. >-Peter Schachte >pds@quintus.uucp >....!sun!quintus!pds Juhana R{s{nen / justus@niksula.hut.fi