sysv equivilant to getwd() -- getcwd()

Lenny Tropiano lenny at icus.islp.ny.us
Sat Jul 22 08:21:16 AEST 1989


In article <1124 at adds.newyork.NCR.COM> tanya at adds.newyork.NCR.COM (Tanya Katz) writes:
|>
|>In-reply-to: your article <15005 at duke.cs.duke.edu>
|>
|>> I am in need of getting the full pathname of the current working directory.
...
|>In system V  there is getcwd(3c)
|>
|>from my manual
|>
|>char * getcwd(buf, size)
|>char *buf;
|>int size;
|>
|>> Thanks for any info.
|>Hope this is on your machine...

The underlying code for getcwd(3C) is pretty simple...  If you notice the
"SEE ALSO" section, you'll figure it out too.   getcwd(3C) basically
malloc's a piece of memory, open's a pipe to pwd(1) using popen(2), and
then reads in the contents of the pwd command.   So if you don't have
this on your machine you should be able to easily make one.

-Lenny
-- 
Lenny Tropiano             ICUS Software Systems         [w] +1 (516) 589-7930
lenny at icus.islp.ny.us      Telex; 154232428 ICUS         [h] +1 (516) 968-8576
{ames,talcott,decuac,hombre,pacbell,sbcs}!icus!lenny     attmail!icus!lenny
        ICUS Software Systems -- PO Box 1; Islip Terrace, NY  11752



More information about the Comp.sys.att mailing list