I’m not really much of a python guy, but I was able to whip this up:
from os import stat
from pwd import getpwuid
def find_owner(filename):
return getpwuid(stat(filename).st_uid).pw_name
More Related Contents:
- Determining Whether a Directory is Writeable
- Dropping Root Permissions In Python
- How do I check whether a file exists without exceptions?
- How to terminate a python subprocess launched with shell=True
- Flask raises TemplateNotFound error even though template file exists
- How do I check file size in Python?
- Getting MAC Address
- Python convert csv to xlsx
- Python pysftp get_r from Linux works fine on Linux but not on Windows
- fcntl substitute on Windows
- How to get PID by process name?
- Using MultipartPostHandler to POST form-data with Python
- .write not working in Python
- Python list directory, subdirectory, and files
- How to make Python script run as service?
- How do you read a file into a list in Python? [duplicate]
- How to update-alternatives to Python 3 without breaking apt?
- How to delete the first line of a text file?
- Trouble installing scipy in virtualenv on a amazon ec2 linux micro instance
- Get all modules/packages used by a python project
- How to delete a specific line in a text file using Python?
- Extracting data from HTML table
- Download and decompress gzipped file in memory?
- Serving large files ( with high loads ) in Django
- Environment Variables when script run by cron
- Why is `with open()` better for opening files in Python?
- How can I extract the folder path from file path in Python?
- Use endswith with multiple extensions
- Multiprocessing: use only the physical cores?
- Best way to choose a random file from a directory