[Python-Dev] os.access versus os.exist

Robert Brewer fumanchu at amor.org
Mon Nov 15 23:16:13 CET 2004


Martin v. Löwis wrote:
> Robert Brewer wrote:
> > 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.
> 
> That's easy enough: just check the exception you get when you try
> opening the file.

Brilliant! I'll do that. I didn't think of open() because I don't need to open it--just see if it's there.

/*bonk* self


Robert Brewer
MIS
Amor Ministries
fumanchu at amor.org


More information about the Python-Dev mailing list