Me: > > > It would be awfully nice (on posix platforms, for my > > > use-case) to find out whether a file is inaccessible > > > due to permission restrictions, or due to non-existence. Guido van Rossum: > > Why can't you solve this by doing a stat() when access() > > returns False? Me: > In my current case, stat() gives an error (even though the > file exists): > > OSError: [Errno 2] No such file or directory: > u'S:/Scans/Projects/2004/TJ/04TJ0267.jpg' > > Running the same stat() call in the interpreter (as opposed > to inside my mod_python app) gives no such error; I get normal stat > output, so the file does exist. I figured since the app was running > as LocalSystem it was a permissions issue. [One quick sanity check > later] Yes, if I run Apache2 under my account, stat() does not error. > > Hm. I see now I'm following the wrong issue. It has more to > do with how Windows shares mapped drives between users (it doesn't). > If I use the UNC path, I don't have an issue. Bah. Spoke too soon. I still have the issue even if I use UNC paths. In Pythonwin interactive session (my logon): os.stat() returns a tuple, os.path.exists() returns True, and os.access() returns True. Inside the app (running under LocalSystem on the same Win2k machine): os.stat() raises OSError: [Errno 2] No such file or directory, os.path.exists() returns False, and os.access() returns False. Robert Brewer MIS Amor Ministries fumanchu at amor.org
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4