[python-win32] DIR reports file timestamp and size, but os.path.getctime(), os.path.getsize() raise WindowsError [Error 5] Access is denied

Preston Landers planders at gmail.com
Tue May 22 03:00:26 CEST 2012


I'm guessing Microsoft set some unusual ACLs on the files for security
reasons.  Have you looked at the advanced security options for these
files in Windows Explorer?  Have you tried running the script as
Administrator?  If you don't really care about the files you can skip
them.  If for some reason you absolutely have to retrieve that info,
you could try tweaking the ACLs or maybe try launching a "dir" process
and parse the output.
-Preston


More information about the python-win32 mailing list