Path: utzoo!attcan!uunet!mcsun!tuvie!iiasa!wnp From: wnp@iiasa.AT (wolf paul) Newsgroups: comp.protocols.nfs Subject: Re: $HOME variable under PC-NFS Summary: ptr = getenv("HOME"); Message-ID: <916@iiasa.UUCP> Date: 26 Oct 90 17:58:17 GMT References: <14598@imag.imag.fr> Reply-To: wnp%iiasa@relay.eu.net (wolf paul) Organization: IIASA, Laxenburg/Vienna, Austria, Europe Lines: 21 In article <14598@imag.imag.fr> fort@imag.fr (Didier FORT) writes: > Does someone knows how to read the $HOME variable defined by PC-NFS >on a PC ? (read in a C program) How about char *ptr, *getenv(); ptr = getenv("HOME"); That would work on reasonably standard C compilers such as MSC or Turbo C. It also works under UNIX. On some compilers you need to pass **envptr as a third argument to main(), and step through it like through **argv to find a string starting with "HOME=", the remainder of the string would be the value. I believe that the final pointer in the array **envptr is (char *)NULL. -- Wolf N. Paul, IIASA, A - 2361 Laxenburg, Austria, Europe PHONE: +43-2236-71521-465 FAX: +43-2236-71313 UUCP: uunet!iiasa.at!wnp INTERNET: wnp%iiasa.at@uunet.uu.net BITNET: tuvie!iiasa!wnp@awiuni01.BITNET * * * * Kurt Waldheim for President (of Mars, of course!) * * * *