Windows: get owner and group of a file

Tim Golden Tim.Golden at viacom-outdoor.co.uk
Wed Dec 6 08:26:07 EST 2006


[kai rosenthal]

| with ls -l on windows I get
| -rw-r--r-- 1 500 everyone 320 Nov 09 09:35 myfile
| 
| How can I get on windows with a standard python 2.2 (without windows
| extensions) the information "500" and "everyone" (owner and group)?
| Also I cannot use popen('ls -l').

Wow. Python 2.2. No extensions. Not even popen (). You don't
want much, do you? I *think* the answer is that you can't. If
you were to loosen up any of your restrictions, you might have
a fighting chance of using (in no particular order):

1) popen ("ls -l") as you suggest. I assume that the restriction
on popen ("ls") extends to popen ("anything else").

2) win32security from the pywin32 extensions

3) ctypes (builtin from Python 2.5; also available as an extension)

TJG

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________



More information about the Python-list mailing list