At Tuesday 31/10/2006 18:01, John Salerno wrote:

What is the best way to check if a file already exists in the current
directory? I saw os.path.isfile(), but I'm not sure if that does more
than what I need.

os.access(full_filename, os.F_OK)
http://docs.python.org/lib/os-file-dir.html

I just want to check if a file of a certain name exists before the user
creates a new file of that name.

Remember that things may change between you check the name and you actually create the file.


--
Gabriel Genellina
Softlab SRL
__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! ¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to