deleting files

Steve Purcell stephen_purcell at yahoo.com
Mon Feb 26 12:11:55 CET 2001


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)

You want:

   os.unlink(filename)

-Steve

-- 
Steve Purcell, Pythangelist
Get testing at http://pyunit.sourceforge.net/
Get servlets at http://pyserv.sourceforge.net/
"Even snakes are afraid of snakes." -- Steven Wright




More information about the Python-list mailing list