[Tutor] aquire user id - uid

Sandip Bhattacharya sandip at linux-delhi.org
Tue Mar 9 01:45:58 EST 2004


Kirk Bailey wrote:
> I want to set the ownership of a file. The command os.setuid(usernumber) 
> demands a NUMBER to set. ok, how do I determine the uid # of a user name?
> 
For your own uid, use os.getuid()

For somebody else's, use pwd.getpwnam()

- Sandip

-- 
Sandip Bhattacharya
sandip (at) puroga.com
Puroga Technologies Pvt. Ltd.
Work: http://www.puroga.com        Home: http://www.sandipb.net

GPG: 51A4 6C57 4BC6 8C82 6A65 AE78 B1A1 2280 A129 0FF3




More information about the Tutor mailing list