ownership

how to find the owner of a file or directory in python

how to find the owner of a file or directory in python Question: I need a function or method in Python to find the owner of a file or directory. The function should be like: >>> find_owner(“/home/somedir/somefile”) owner3 Asked By: ramdaz || Source Answers: You want to use os.stat(): os.stat(path) Perform the equivalent of a …

Total answers: 7