Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8006635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:34:41+00:00 2026-06-04T17:34:41+00:00

Firstly is it possible to set a file’s owner with python? And if so

  • 0

Firstly is it possible to set a file’s owner with python?
And if so how do you set a file’s owner with python?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T17:34:44+00:00Added an answer on June 4, 2026 at 5:34 pm
    os.chown(path, uid, gid)
    

    http://docs.python.org/library/os.html

    The uid and gid can be retrieved from a string by

    import pwd
    import grp
    import os
    
    uid = pwd.getpwnam("nobody").pw_uid
    gid = grp.getgrnam("nogroup").gr_gid
    

    Reference: How to change the user and group permissions for a directory, by name?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Firstly, here's my script: #!/usr/bin/python import sys, os sys.path.append('/home/username/python') sys.path.append(/home/username/python/flup) sys.path.append(/home/username/python/django) # more path
Firstly is it possible to use objective C to find out if the user's
Possible Duplicate: How do I concatenate strings in Objective-C? Firstly, the platform is iPhone
My question is two fold, firstly, is it possible to create a foreign key,in
2 Questions : Firstly: Is it possible to Toggle Transparency on a WPF window?
Is it possible to do Virtual Machine(VM) provisioning? Firstly I have a some questions
Possible Duplicate: In Java, what does a reference to Class.class do? Firstly apologies for
Possible Duplicate: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive Firstly, let me
Is it possible to convert/reassemble the Object to Hash Object? For example and firstly,
Possible Duplicate: why "++x || ++y && ++z" calculate "++x" firstly ? however,Operator "&&"

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.