Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!mit-eddie!bu-cs!halleys!ulowell!page From: page@ulowell.UUCP Newsgroups: comp.sys.amiga Subject: Re: chdir() bug in Lattice Message-ID: <1212@ulowell.cs.ulowell.edu> Date: Thu, 23-Apr-87 12:41:11 EST Article-I.D.: ulowell.1212 Posted: Thu Apr 23 12:41:11 1987 Date-Received: Sat, 25-Apr-87 05:08:10 EST References: <1720@husc6.UUCP> Reply-To: page@ulowell.cs.ulowell.edu (Bob Page) Organization: University of Lowell Lines: 18 >I can't see how one can implement chdir() to be UNIX-compatible UNIX chdir doesn't remember the old directory. Use: newdir = Lock(pathname,ACCESS_READ) ; /* get a lock on the file */ UnLock(CurrentDir(newdir)) ; /* change to it, unlock */ /* the old directory */ Note you should check to make sure the Lock() succeeded and that 'pathname' is a directory before you do the Currentdir(). Of course if your application NEEDS to remember the old directory, save it yourself. chdir() shouldn't have to. It's still a bug in the Lattice library, however, since they don't UnLock the old directory. ..Bob -- Bob Page, U of Lowell CS Dept. page@ulowell.{uucp,edu,csnet}