Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1exp 10/6/83; site ihuxa.UUCP Path: utzoo!linus!philabs!cmcl2!floyd!clyde!ihnp4!ihuxa!dixon From: dixon@ihuxa.UUCP (D. A. Dixon) Newsgroups: net.unix Subject: Re: Getting the cwd from within a C program Message-ID: <311@ihuxa.UUCP> Date: Wed, 19-Oct-83 13:37:02 EDT Article-I.D.: ihuxa.311 Posted: Wed Oct 19 13:37:02 1983 Date-Received: Thu, 20-Oct-83 08:37:58 EDT Organization: AT&T Bell Labs, Naperville, Il Lines: 10 If your system has the getcwd(3) library routine, then that will give you the current working directory. If your system does not have getcwd(3) OR you do not want to use it (because it uses popen() and 'pwd' as noted by Guy Harris), then you can use the undocumented library routine curdir() in libPW.a. This routine takes as an argument the address of an array in which it can place the current directory. Since the routine is undocumented you cannot assume it will be around in future releases of UN*X. NOTE: Don't forget to compile with -lPW. D A Dixon ihuxa!dixon BTL - IH