Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!nuchat!sugar!schaub
From: schaub@sugar.UUCP (Markus Schaub)
Newsgroups: comp.sys.amiga
Subject: Re: How to cd, and disk drive trouble
Message-ID: <1245@sugar.UUCP>
Date: Mon, 7-Dec-87 11:17:42 EST
Article-I.D.: sugar.1245
Posted: Mon Dec  7 11:17:42 1987
Date-Received: Sun, 13-Dec-87 01:44:18 EST
References: <796@rocky.STANFORD.EDU> <1237@sugar.UUCP>
Organization: Sugar Land UNIX - Houston, TX
Lines: 27

In article <1237@sugar.UUCP>, peter@sugar.UUCP (Peter da Silva) writes:
> In article <796@rocky.STANFORD.EDU>, ali@rocky.STANFORD.EDU (Ali Ozer) writes:
> > What's the correct way to change directories in a program without going
> > back to the original directory at the end? You first obtain a lock, with
> 
> You UnLock() any lock *you* obtain (==Lock()). Your original directory wasn't
> Lock()ed by you, so you better not UnLock it. Otherwise either CLI will be

To my knowledge CurrentDir just replaces the process's currentDir lock.
To write a cd program you

-	lock the new directory
-	call CurrentDir()
-	unlock the returned old lock

So Peter, here I think you have to unlock something you did not lock yourself
and leave something locked you locked.

The only problems I had were the locks for Workbench arguments. Where am I
starting, etc. There I decided to leave all locks locked and I assume WB
does the unlocking.

-- 
     //	Markus Schaub		uunet!nuchat!sugar!schaub      (713) 523 8422
    //	M2Amiga Developer	trying to get back the money I  paid  for  my
\\ //				Amiga by selling a few M2Amiga.
 \X/	c/o Interface Technologies Corp, 3336 Richmond #323, Houston Tx 77098