Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Greetings idl ones, I'm a WinNT weenie, but would like to find out how to identify a user when the user starts an IDL procedure, on both NT and UNIX OS. Is this possible under unix? Can I do something like cd ~ and grab the folder name, or spawn and call whoami? Actually, nevermind, I'll spawn and call whoami. Is there a more general solution? Is user ID possible under WinNT? As a general solution, is there an IDL system variable that holds this info? (searching for "user" or "who" or "system" is about as useful as searching for the letter "e") thanks, bob "Thou shalt not worship false IDLs" Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.
rgs <dejastockwell@my-deja.com> wrote in message news:7nkrp3$foc$1@nnrp1.deja.com... > Greetings IDL ones, > > I'm a WinNT weenie, but would like to > find out how to identify a user when > the user starts an IDL procedure, on both > NT and UNIX OS. Under NT get the value (IDL procedure GETENV) of the environment variable USERNAME. Under Win95/98 (which you didn't ask about) USERNAME is not set automatically on login, but it could be set in autoexec.bat. Environment variables are case-insensitive in Windows. With Unix the corresponding variable appears to depend on the shell, e.g. LOGNAME in the C shell and USER in the bash shell, so I guess trapping the output of whoami is the most general solution. --- Mark Hadfield m.hadfield@niwa.cri.nz National Institute for Water and Atmospheric Research PO Box 14-901, Wellington, New Zealand