using ftpdelete with a wildcard

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a module that I've written that uses wininet.dll to delete files via
Access. I can easily delete a file if I know it's entire filename, however,
I'm having a problem with being able to delete a file that I only know a
partial file name.

The reason I need to be able to do this is the following. Once a week I have
the windows task scheduler open access and upload a series of files to an ftp
site. In the file name I have the date that the file was created and the
number of records (per managment request). So one of my file names looks
like:

ExampleFile1252453_112805.txt

Now I'll always know the date for the file and the beginning file name, as
its done every Friday, and the beginning of the file name is hard coded. What
I won't know is the number of records.

If there is any way to use a wildcard to delete a remote file I'd greatly
appreciate any help that could be provided.

Thanks

James
 
I used
With Application.FileSearch
with
.MatchTextExactly = False
to find the filename, before deleteing it.

Maybe this will work for you.
 
AFAIK ftp doesn't offer wildcard deletes. If so, you'll need to send
ls
to get the list of files in the folder, then parse the result to get the
list of files you want to delete, and finally either delete them one at
a time or else build and send the appropriate mdelete command.

That appears to be what happens when I use a GUI ftp client to do
multiple deletes.
 
that's what I thought, thanks anyway.

John Nurick said:
AFAIK ftp doesn't offer wildcard deletes. If so, you'll need to send
ls
to get the list of files in the folder, then parse the result to get the
list of files you want to delete, and finally either delete them one at
a time or else build and send the appropriate mdelete command.

That appears to be what happens when I use a GUI ftp client to do
multiple deletes.
 
Back
Top