Re: FTp client - get newest file given base name only

Giganews Newsgroups
Subject: Re: FTp client - get newest file given base name only
Posted by:  J. Peter Mugaas (oma002…@mail.wvnet.edu)
Date: Thu, 27 Apr 2006

On Mon, 10 Apr 2006 11:47:39 +0100, "Eric Carlson"
<eric.removethis.carlson@group-technical-andthis.com> wrote:

>This is for WiFi cameras which timestamp their files, such as
>Basename-20060401103021.jpg, Basename-20060401103022.jpg etc.
>I have the Indy 9 ftp client working for a fully qualified filename but want
>the newest in these circumstances please. Thank you.

You might be able to use TIdFTP.SetModTimeGMT or possibly
TIdFTP.SetModTime (local time) but those will only work if the MDTM
command is supported by the server.  There are still a few servers
that still don't support it.

Other than that, you might be able to have success using the LIST
method.  If the server support MLSD, you should be able to get a date
you could use.  If not, times are usually reported based on the
server's time zone setting.  The form common list form (Unix) will
only return either a year if the file is over six months old or a
time-stamp if it is less than six month's old.  In other words, you
mill age may vary.

HTH.

--
J. Peter Mugaas - Indy Pit Crew
Internet Direct (Indy) Website -http://www.indyproject.org
Check our my blog at
http://www.indyproject.org/Sockets/Blogs/JPeterMugaas/index.iwp
If I want to do business with you, I will contact you.  Otherwise, do
not contact me.

Replies

None

In response to

FTp client - get newest file given base name only posted by Eric Carlson on Mon, 10 Apr 2006