[python-win32] windows file name property
timr at probo.com
Fri Mar 14 23:14:32 CET 2008
Chris Johnson wrote:
> I am trying to print the attributes of a file.
> The want I am most interested in is the owner. This is on windows xp.
> Any help would be appreciated.
o = win32security.GetFileSecurity( filename,
s = o.GetSecurityDescriptorOwner()
# This prints the SID form:
# This gets the human-readable form:
s2 = sec.LookupAccountSid( '.', s )
# (u'timr', u'PROBO', 1)
That says this file is owned by user "timr" in domain "PROBO". The "1"
means this is a user, not a group (win32security.SidTypeUser).
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the python-win32