James Colannino <[EMAIL PROTECTED]> wrote:
>
>Hey everyone.  I tried to use os.chown() in the following manner:
>
>os.chown('filename', 'username', 'groupname')
>
>I got an error, and when I googled for this function I realized that I 
>must pass the numerical uid and gid.  My question is, is there a way for 
>me to change ownership based on the name instead of the number?  Perhaps 
>there's a function that will let me lookup the uid from the username, 
>and the gid from the groupname?

One way is:
  os.system( 'chown username:groupname filename')

Are you doing this as root?  The chown function is usually restricted to
root.
-- 
- Tim Roberts, [EMAIL PROTECTED]
  Providenza & Boekelheide, Inc.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to