Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!seismo!hao!hplabs!sri-unix!unix-wizards-request@brl-vgr From: unix-wizards-request@brl-vgr@sri-unix.UUCP Newsgroups: net.unix Subject: PWD Help Request Message-ID: <12529@sri-arpa.UUCP> Date: Wed, 12-Oct-83 19:30:21 EDT Article-I.D.: sri-arpa.12529 Posted: Wed Oct 12 19:30:21 1983 Date-Received: Mon, 17-Oct-83 22:44:56 EDT Lines: 34 From: Mike Muuss ----- Forwarded message # 1: Received: From Seismo.ARPA by BRL-VGR via smtp; 12 Oct 83 19:22 EDT Date: 12 Oct 83 19:21:29 EDT (Wed) From: rlgvax!cal-unix!wise@SEISMO Subject: Getting the cwd from within a C program Posted-Date: 12 Oct 83 19:21:29 EDT (Wed) Message-Id: <8310122321.AA17334@SEISMO.ARPA> Received: by SEISMO.ARPA (3.342/3.21) id AA17334; 12 Oct 83 19:21:29 EDT (Wed) To: rlgvax!seismo!unix-wizards-request@BRL-VGR.ARPA Does anybody out there know of an easy way to get the current directory from within a C program? Easy meaning not using popen ("pwd ... or system ("pwd > ... The envp argument to main doesn't include this information. We'd also like to avoid explicitly passing it from the shell, as an argument or whatever. Is the only choice to hack pwd.c into a subroutine? If so, and you've already done so, we'd appreciate a copy. Thanks in advance. Rick Wise wise@mit-ml ----- End of forwarded messages