Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
与此处相同的问题,但适用于 Windows。
这个答案在 Linux 中运行良好:
from os import stat from pwd import getpwuid def find_owner(filename): return getpwuid(stat(filename).st_uid).pw_name
该模块pwd在 Windows 中似乎不可用。
pwd
如何在 Windows 中做到这一点?