VAX-C question on passwords

Rick Murphy murphy at ufp.dco.dec.com
Sat Aug 25 12:13:14 AEST 1990


In article <1990Aug24.220621.2506 at athena.mit.edu>, seaotter at 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 at ufp.dco.dec.com -or- murphy at 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.



More information about the Comp.lang.c mailing list