I need the function or method in Python to find the file or directory owner.
The function should be like:
& gt; & Gt; & Gt;
I'm not really / remove ("/ home / somedir / somefile" one Many of the dragon man, but I was able to whip it: PWD Import from getpwuid def find_owner (filename) from OS import state
: return getpwuid (state (filename) .st_uid). Pw_name
No comments:
Post a Comment