File Path retrieving problem

Peter Otten __peter__ at web.de
Wed Feb 25 18:18:11 CET 2009


Steve Holden wrote:

> What, you are saying that
> 
> os.path.exists(filename)
> 
> is returning false when the file exists? I find that hard to believe.
> 
> Please display some evidence so I can understand this.

Maybe it's about access rights?

$ mkdir alpha
$ touch alpha/beta
$ python -c"import os; print os.path.exists('alpha/beta')"
True
$ chmod u-x alpha
$ python -c"import os; print os.path.exists('alpha/beta')"
False
$

I Don't know how this is handled on Windows...

Peter



More information about the Python-list mailing list