deleting files

Thomas Wouters thomas at xs4all.net
Mon Feb 26 06:11:04 EST 2001


On Mon, Feb 26, 2001 at 12:53:50PM +0200, James Lockley wrote:

> i want to delete a file created after a particular time ( ie something like
> if os.path.getmtime(file)>t0: <delete(file>)
> i've looked through shutil and can't find anything to use... (i don't want
> to delete tree so rmtree is of no use)

Deleting a single file is done using os.remove(). Deleting a directory is
done using 'os.rmdir()'.

-- 
Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!




More information about the Python-list mailing list