Deleting files on ftp site, with zero size - WeOnlyDo Discussion board

Deleting files on ftp site, with zero size (wodFtpDLX / wodFtpDLX.NET)

by scots, Friday, January 31, 2014, 20:22 (3735 days ago)

I have a client, who runs a process every days
and it will create a file regardless of whether there is
data to put into the file or not.

so.. they will end up with a lot of files, with a size of zero
is there an easy way for me to do that?

maybe with a listdir?
I will have to use a wildcard, to only get files that start with
certain text

is it possible to do a delete, inside of a loopitem?

seems like it would be easier for them, to do the delete on their end
but, they are unwilling to

I'd appreciate any suggestions. Thanks

Deleting files on ftp site, with zero size

by wodSupport, Friday, January 31, 2014, 20:58 (3735 days ago) @ scots

I think you cannot use our internal functions for automation. What I think you could od is do a ListDir, and then, when you have all the information about files and their sizes, put ones you want to download in some local collection. And then

while (collection.size > 0)
ftp1.deletefile collection[0]
collection.erase(0)
end while

so, as long as there are elements (ones you put there, by your decisions) delete them.

That's one of possible ideas.

Kreso