Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!bellcore!att!icus!lenny From: lenny@icus.islp.ny.us (Lenny Tropiano) Newsgroups: comp.sys.att Subject: Re: sysv equivilant to getwd() -- getcwd() Message-ID: <925@icus.islp.ny.us> Date: 21 Jul 89 22:21:16 GMT References: <1124@adds.newyork.NCR.COM> Reply-To: lenny@icus.islp.ny.us (Lenny Tropiano) Organization: ICUS Software Systems, Islip, New York Lines: 29 In article <1124@adds.newyork.NCR.COM> tanya@adds.newyork.NCR.COM (Tanya Katz) writes: |> |>In-reply-to: your article <15005@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@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