PEP262 - database of installed packages
Wolfgang Strobl
ws at mystrobl.de
Mon Mar 25 20:33:08 EST 2002
Mon, 25 Mar 2002 17:06:45 +0100, "Thomas Heller" <theller at python.net>:
>All true. On the other hand, Python has no possibility to display
>or change the owner and access control lists (except if you do some
>hardcore win32 programming).
I would't call the following three-liner "hardcore win32 programming".
:-)
C:\>python
Python 2.2 (#28, Dec 21 2001, 12:21:22) [MSC 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from win32security import *
>>>
>>> def owner(filename):
...
ownerdescriptor=GetFileSecurity(filename,OWNER_SECURITY_INFORMATION)
... owner=ownerdescriptor.GetSecurityDescriptorOwner()
... ownername=LookupAccountSid(None,owner)
... return ownername[0]
...
>>> print owner("c:\\boot.ini")
Administratoren
>>>
--
Wir danken für die Beachtung aller Sicherheitsbestimmungen
More information about the Python-list
mailing list