Why use pwd(1) for getpwd(3C)? (Re: Why use find?)

Guy Harris guy at auspex.auspex.com
Sun Oct 14 07:08:37 AEST 1990


 >       *  Getwd changes directories (uses the system call chdir) to figure out
 >          which directory you are in. If there is an error, getwd may not be
 >          able to change back to the directory you were in when you called it.
 >          If this occurs, any files created will be in the wrong place.

That may be true on your system - the 4.2BSD "getwd()" routine did, in
fact, use "chdir()" - but it's not ture on all systems; the 4.3BSD
"getwd()" doesn't use "chdir()".



More information about the Comp.unix.programmer mailing list