Discussion:
idFTP DirectoryListing ModifiedDate error
(too old to reply)
Shane
2008-07-20 18:07:34 UTC
Permalink
i am not getting the right date on my files when i look at the ModifiedDate

see code below

idFTP1.Connect;
idFTP1.ChangeDIr('/public_ftp/data_files');
idFTP1.List(nil, '*.dat');
for I:= 0 to idFTP1.DirectoryListing.Count-1 do
begin
AModDate := idFTP1.DirectoryListing[I].ModifiedDate;
if AModDate > gLastDownLoadDate then
begin
lbxFiles.Add(idFTP1.DirectoryListing[I].FileName);
end;
end;


The year is showing as 2007 - when the files are stamped with 2008

what is going on?

i added IdAllFTPListParsers to my uses clause
Remy Lebeau (TeamB)
2008-07-21 06:33:33 UTC
Permalink
Post by Shane
i am not getting the right date on my files when i look at the ModifiedDate
Which version of Indy are you using? What does the raw directory data look
like?


Gambit
Shane Holmes
2008-07-21 14:40:10 UTC
Permalink
Im using the latest stable version

When I look at the directory using a FTP client, it shows the correct date

When I downlaod the files using a FTP client, they come accross as the
correct date

if I place a showmessage in the code, it shows a different year (off by one
year)
Which of course then makes my if then false

AModDate := idFTP1.DirectoryListing[I].ModifiedDate;
ShowMessage(DateToStr(AModDate));
if AModDate > gLastDownLoadDate then
Post by Remy Lebeau (TeamB)
Post by Shane
i am not getting the right date on my files when i look at the ModifiedDate
Which version of Indy are you using? What does the raw directory data
look like?
Gambit
Remy Lebeau (TeamB)
2008-07-21 16:53:55 UTC
Permalink
Post by Shane Holmes
Im using the latest stable version
Which actual build number do you consider to be the latest "stable" version?
Post by Shane Holmes
When I look at the directory using a FTP client, it shows the correct date
That does not tell me anything useful. Again, please provide the data I
asked for earlier. That is the only way to diagnose the problem.


Gambit
Shane Holmes
2008-07-21 17:43:09 UTC
Permalink
Sorry, I am a novice

Not sure what youa re asking

I downloaded the version offered here

http://www.indyproject.org/Sockets/Download/Files/Indy10.EN.aspx

I believe its 10.xxxx

I can't find anything anywhere that tells me the minor version. I downlaoded
it on Sunday.

As for the Raw Directory data. I do not know what you mean by this

thanks

shane
Post by Remy Lebeau (TeamB)
Post by Shane
i am not getting the right date on my files when i look at the ModifiedDate
Which version of Indy are you using? What does the raw directory data
look like?
Gambit
Remy Lebeau (TeamB)
2008-07-21 18:55:36 UTC
Permalink
Post by Shane Holmes
Sorry, I am a novice
Not sure what youa re asking
I am asking you to provide a sample of the raw data that the FTP server is
sending for the directory listing. Use an external packet sniffer, such has
Ethereal/Wireshark, for that. Or attach a TIdLog... component to TIdFTP
before connecting to the server. Either way, someone can then see how the
data is actually being parsed. As well as determine which parser TIdFTP is
using to begin with (Indy 10 has several dozen FTP directory listing parsers
available), or at least report what the TIdFTP's DirFormat property contains
after accessing the DirectoryListing property for the first time when
calling List().
Post by Shane Holmes
I downloaded the version offered here
http://www.indyproject.org/Sockets/Download/Files/Indy10.EN.aspx
I believe its 10.xxxx
What EXACTLY did you download from that page, though? There are 3 links to
different versions on it.
Post by Shane Holmes
I can't find anything anywhere that tells me the minor version.
Right-click on any Indy component inside the IDE's Form Designer. You can
get the installed version from the popup menu that appears.


Gambit

Loading...