Same question as here, but for Windows.
This answer works nicely in Linux:
from os import stat
from pwd import getpwuid
def find_owner(filename):
return getpwuid(stat(filename).st_uid).pw_name
The module pwd
doesn't seem to be available in Windows.
How to do that in Windows?