multiple file deletes using ftp.delete

Drew nospam.notospam at gmail.com
Sat Jan 20 02:16:18 EST 2007


Hi all
I'm fairly new to python so please forgive my lack of comprehension of
the obvious.

I'm writing a script to ftp files to a server. This script will run
weekly. Part of the script first deletes the previous weeks files. The
problem is I'm never sure of the exact number and full name of the
files that need to be deleted. All the files start with the same string
but have different extensions (eg drew.1 drew.2 drew.tmp drew.hlp). So
I was wondering if anybody knows how to use a wild card similar to * in
UNIX to do the delete? Something like:

ftp.delete("drew.*")

Any help or suggestions would be greatly appreciated.

Drew Dowling




More information about the Python-list mailing list