Delete all ftp files from a directory

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
lcrltd
Junior Coder
Posts: 35
Joined: Thu Nov 16, 2006 8:23 am

Delete all ftp files from a directory

Post by lcrltd » Fri Nov 30, 2007 12:28 pm

I am trying to write a routine that will delete all the files within an ftp folder.
The name of the files may change and so a specific one to remove specific names is no good.
Can anyone help please?

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Nov 30, 2007 1:19 pm

Use FTPGetDirList to get a list of files, then loop through it and do FTPDelFile for each one.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

lcrltd
Junior Coder
Posts: 35
Joined: Thu Nov 16, 2006 8:23 am

Post by lcrltd » Wed Dec 05, 2007 8:26 am

Thanks. That worked fine.

Dominic_Fichera
Pro Scripter
Posts: 82
Joined: Mon Mar 24, 2014 12:15 pm

Re: Delete all ftp files from a directory

Post by Dominic_Fichera » Thu Sep 04, 2014 10:40 am

Following on from this one, I've just tried to search for files on a server using the FTPGetDirList and then output the result to MessageModal to see what I can find and all it says is:
226-Options: -a -l
2 matches total
Any idea how to have it tell me the file names? I want to be able to create that loop to delete all files in the directory. also, the results say 2 files... There are 3 files in the directory. I have the search function set to Wildcard (*) and the type set to L.

Thanks in advance :)

Dominic Fichera

*UPDATE* Please disregard this post. I have found the local file with the information.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts