Xref: utzoo comp.os.vms:29533 comp.lang.c:31358 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!aplcen!decuac!ufp.dco.dec.com!murphy From: murphy@ufp.dco.dec.com (Rick Murphy) Newsgroups: comp.os.vms,comp.lang.c,vmsnet.misc Subject: Re: VAX-C question on passwords Message-ID: <1990Aug24.220834@ufp.dco.dec.com> Date: 25 Aug 90 02:13:14 GMT References: <1990Aug24.220621.2506@athena.mit.edu> Sender: guest@decuac.DEC.COM Reply-To: murphy@ufp.dco.dec.com Followup-To: comp.os.vms Distribution: na Organization: Digital Equipment Corporation, Landover MD Lines: 28 In article <1990Aug24.220621.2506@athena.mit.edu>, seaotter@athena.mit.edu (Stacy L Ramirez) writes: >I am looking (without access to decent manuals, of course :-( for >the VMS/VAX-C equivalent of the following unix C code: > > if (( pp = getpwuid(getuid()) == NULL ) { > pwdir = "???"; > login = "???"; > } > else { > pwdir = pp->pw_dir; > login = pp->pw_name; > } > #ifdef VMS pwdir = getenv("HOME"); login = getenv("USER"); #endif If you want the CURRENT directory the user is in, that's getenv("PATH"). getenv also can be used to translate logicals and DCL symbols. -Rick -- Rick Murphy, WA1SPT/4 Digital Customer Center, Landover, MD Domain: murphy@ufp.dco.dec.com -or- murphy@ufp.enet.dec.com Bang: decwrl!ufp.enet!murphy Ding: (301) 306-2985 Disclaimer: This nonsense came from an AI program written in TECO. Ignore it.