[Tutor] Does directory exist?

Michael Janssen Janssen@rz.uni-frankfurt.de
Thu Apr 3 15:38:02 2003


On Thu, 3 Apr 2003, Michael Montagne wrote:

> What is the best way to check for the existence of a directory?
> I used os.stat() in a try:except: statement.  It seems the os.access()
> function is intended for this but I can't get it to accept F_OK as the
> mode argument.

Your problem is already solved by Danny but for interesset:

F_OK is nothing else as a variable defined in the os-modul. So you have to
use: os.F_OK

Michael

>
>
> --
>   Michael Montagne  http://www.themontagnes.com  503.226.1575
> --
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>