home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.sys.sun.admin:9342 comp.sys.sun.misc:5810
- Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!wupost!cs.utexas.edu!asuvax!ncar!hsdndev!news.cs.umb.edu!rouilj
- From: rouilj@dl5000.bc.edu (John P. Rouillard)
- Newsgroups: comp.sys.sun.admin,comp.sys.sun.misc
- Subject: Re: problems with pathnames on automounted systems
- Message-ID: <ROUILJ.92Dec11155326@dl5000.bc.edu>
- Date: 11 Dec 92 20:53:26 GMT
- References: <ByLrGL.FAs@cs.bham.ac.uk> <1992Dec2.204641.1149@zia.aoc.nrao.edu>
- <BypHr4.Crz@cs.bham.ac.uk> <DERAADT.92Dec5150443@newt.newt.cuc.ab.ca>
- Sender: news@cs.umb.edu (USENET News System)
- Organization: Institute for Space Research, Boston College
- Lines: 26
- In-Reply-To: deraadt@newt.cuc.ab.ca's message of 5 Dec 92 22: 04:43 GMT
- Nntp-Posting-Host: dl5000.bc.edu
-
-
- In article <DERAADT.92Dec5150443@newt.newt.cuc.ab.ca> deraadt@newt.cuc.ab.ca (Theo de Raadt) writes:
-
- > In a program we have that needs to know what the real(TM) directory path
- > is, I follow this scheme....
- >
- > char cwd[MAXPATHLEN];
- > char *s;
- >
- > getcwd(cwd, sizeof cwd)
- > if( (s=getenv("PWD")) != NULL)
- > strncpy(cwd, s, sizeof cwd);
- >
- > Many modern shells will also export the variable $cwd into $PWD. There's
- > no better way to deal with it at the moment.
- > <tdr.
-
-
- Well, I would also check the inode, and device numbers before relying
- on $PWD. I have seen $PWD get out of sync on occasion.
-
- Also, if you run the AMD automounter, you can just query the
- automounter and use the info from the automounter to construct the
- logical directory path. It really works quite well.
-
- -- John
-