Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.unix.questions Subject: Re: /bin/pwd Message-ID: <13851@smoke.BRL.MIL> Date: 13 Sep 90 21:40:32 GMT References: <2488@idunno.Princeton.EDU> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 8 In article <2488@idunno.Princeton.EDU> pfalstad@phoenix.Princeton.EDU (Paul John Falstad) writes: >Can anyone tell me how /bin/pwd works? I thought it was a trivial >program until I tried to write my own without getcwd(3). getcwd is not >a system call, so it must be possible. The way I think it works is >quite complicated, so I thought there would be an easier way. No, on most systems there is no easier way than the obvious one of seeing where a succession of ".."s gets you.