Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!sri-spam!mordor!styx!ames!oliveb!sun!cmcmanis From: cmcmanis@sun.uucp (Chuck McManis) Newsgroups: comp.sys.amiga Subject: Re: chdir() bug in Lattice Message-ID: <17331@sun.uucp> Date: Fri, 24-Apr-87 12:59:20 EST Article-I.D.: sun.17331 Posted: Fri Apr 24 12:59:20 1987 Date-Received: Sun, 26-Apr-87 01:22:43 EST References: <1720@husc6.UUCP> <1212@ulowell.cs.ulowell.edu> Organization: Sun Microsystems, Inc. - Mtn View, CA Lines: 26 Summary: Bad news for Lattice fans In article <1212@ulowell.cs.ulowell.edu>, (Bob Page) writes: > >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(). > ..Bob Last time I checked the Lattice Startup code a copy of the Lock on the current directory and then Unlocked it on exit. The end result was that UnLock(CurrentDir(newdir)); would cause a GURU on exit from the program when exit() tried to UnLock the directory again. I will check the c.a code when I get home to verify the exact sequence that causes it to fail. -- --Chuck McManis uucp: {anywhere}!sun!cmcmanis BIX: cmcmanis ARPAnet: cmcmanis@sun.com These views are my own and no one elses. They could be yours too, just call MrgCop() and then ReThinkDisplay()!