[Tutor] uid

Hans Gubitz gubitz@netcologne.de
Sat, 15 Sep 2001 12:17:56 +0200


I want to cp a file and extract it to different users. I can do this
as root, but I want extract  to be done with the uid of the user.

import os, pwd
users = ['usera','userb']

def copy(user):
        list = pwd.getpwnam(user)
        #uid = list[2]
        home = list[5]
        os.chdir(home)
        os.system('cp /tmp/file.tgz .')
        os.system('tar -xzf file.tgz')

for u in info_1:
        copy(u)
            
        
??????        
-- 
Hans Gubitz <gubitz@netcologne.de>