PWD Help Request

unix-wizards-request at brl-vgr unix-wizards-request at brl-vgr
Thu Oct 13 09:30:21 AEST 1983


From:      Mike Muuss <unix-wizards-request at brl-vgr>


----- 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 at SEISMO
Subject: Getting the cwd from within a C program
Posted-Date: 12 Oct 83 19:21:29 EDT (Wed)
Message-Id: <8310122321.AA17334 at 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 at 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 at mit-ml





----- End of forwarded messages



More information about the Comp.unix mailing list