how to get the username lazarus / 32-Linux ---------------------------------------------------------------------- a.atalla · 2010-07-07 10:42 i need the user name to use in my application i couldnot found the function that returns the user-name  in linux ---------------------------------------------------------------------- theo · 2010-07-07 10:55 GetEnvironmentVariable('USER'); ---------------------------------------------------------------------- typo · 2010-07-07 11:44 GetEnvironmentVariable('USERNAME'); ---------------------------------------------------------------------- a.atalla · 2010-07-07 14:15 Quote from: theo on July 07, 2010, 12:55:34 pmGetEnvironmentVariable('USER');        that works ,but now my application will run with root priviliage so that function will return "root"  as the user name is there any way i can list all the computer users "not only the current user" ? ---------------------------------------------------------------------- theo · 2010-07-07 14:49 What do you want to achieve? Sounds like you don't know yourself ;-) http://forum.lazarus.freepascal.org/index.php/topic,9770.msg48175.html #msg48175 ---------------------------------------------------------------------- a.atalla · 2010-07-07 15:01 GetEnvironmentVariable('USER');        this one was what i'm looking for but now i need another thing my application will run on the user machine with root privilege ,and it will do some admin stuff on other users account ,so i need to know what the other users that use the computer i wish that is clear does the post u linked belongs to my question? ---------------------------------------------------------------------- theo · 2010-07-07 15:11 Quote from: a.atalla on July 07, 2010, 05:01:20 pmdoes the post u linked belongs to my question? Yes. ---------------------------------------------------------------------- Laksen · 2010-07-07 17:49 It's easy. Take a look at the users unit in the users fpc package. It contains everything you need. GetUserList, and GetUserData combined with FpGetuid from baseunix sounds like what you want That's ofcourse a very unix specific unit