[pyar] problema con archivos

Federico Wagner federico.wagner en gmail.com
Jue Abr 28 15:04:29 ART 2011


> f_in = open('./error.log', 'rb')
> IOError: [Errno 2] No existe el fichero o el directorio: './error.log'
>
>
>
y si en lugar de usar el popen usas la función os.remove(path) ?

os.remove(*path*)¶ <http://docs.python.org/library/os.html#os.remove>

Remove (delete) the file *path*. If *path* is a directory,
OSError<http://docs.python.org/library/exceptions.html#exceptions.OSError>is
raised; see
rmdir() <http://docs.python.org/library/os.html#os.rmdir> below to remove a
directory. This is identical to the
unlink()<http://docs.python.org/library/os.html#os.unlink>function
documented below. On Windows, attempting to remove a file that is
in use causes an exception to be raised; on Unix, the directory entry is
removed but the storage allocated to the file is not made available until
the original file is no longer in use.
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://listas.python.org.ar/pipermail/pyar/attachments/20110428/6ed671de/attachment.html>


More information about the pyar mailing list