[Tutor] Test for file existance

Jeff Shannon jeff at ccvcorp.com
Mon Aug 30 21:48:37 CEST 2004

Klas Marteleur wrote:
> I wanna test for file existance using os.access
> I have tried the following but none seem to work
> os.access("/home/klas/epa.txt", F_OK)
> os.access("/home/klas/epa.txt", f_ok)
> os.access("/home/klas/epa.txt", "F_OK")
> os.access("/home/klas/epa.txt", "f_ok")
> but i get the following error:

Have you tried os.path.exists() ?


Hope that helps you out. :)

Jeff Shannon
Credit International

More information about the Tutor mailing list