+1 vote

Hi Guys,

I'm getting a list of FtpItems from a remote path but only want recently modified items.

As an example the variable DownloadFileModifyDate is set to 16/January/2016.

List<FtpItem> baseComparer = client.GetList(ftpFileSetting.RemotePath)
                                              .Where(x => x.ModifyDate > DownloadFileModifyDate).ToList();

However when i look at the modified date of the files all their dates are in 2017 which is incorrect.

enter image description here

Looking at another FTP client FileZilla the date is correct.

enter image description here

Lastly calling the method on the client object client.GetFileModificationTime yields the correct result as shown below.

client.GetFileModificationTime("balve/errors/4549aug16ACBABSAVET2990729_DOReject.TXT.zip");
{2016/08/02 8:09:03 AM}
Date: {2016/08/02 12:00:00 AM}
Day: 2
DayOfWeek: Tuesday
DayOfYear: 215
Hour: 8
Kind: Local
Millisecond: 0
Minute: 9
Month: 8
Second: 3
Ticks: 636057221430000000
TimeOfDay: {08:09:03}
Year: 2016

Any help is appreciated as i'm not quite sure where to head is this a bug ?

by (720 points)
Could you please turn on logging:
https://www.limilabs.com/blog/logging-in-ftp-dll

It looks like a bug.
Hi,

I've pasted an extract of the logs below.

C: LIST ba_lve/errors
S: 150 Opening ASCII mode data connection for file list
Data connection established.
S: 226 Transfer complete
S:
-rw-rw-rw-   1 279      staff         285 Apr 25  2016 apr16_3.TXT.zip
-rw-rw-rw-   1 279      staff         892 Apr 25  2016 apr16_5.TXT.zip
-rw-rw-rw-   1 288      staff         286 Apr 29  2016 apr16_0.TXT.zip
-rw-rw-rw-   1 oracle   oinstall      959 Aug  2 08:09 aug16_VET9.TXT.zip
-rw-rw-rw-   1 oracle   oinstall      974 Aug  3 08:04 aug16_VET1.TXT.zip
-rw-rw-rw-   1 oracle   oinstall      757 Aug  5 04:06 aug16_VET7.TXT.zip
-rw-rw-rw-   1 oracle   oinstall      589 Aug  6 08:05 aug16_VET6.TXT.zip
-rw-rw-rw-   1 oracle   oinstall      630 Aug  7 04:04 aug16_VET8.TXT.zip

Weird how the year is all of a sudden lost, is this maybe on the Ftp hosts side or is this still looking like a bug?
Are you using GetList method?
Yes i'm using the GetList method
Good, GetList uses MLSD command if server supports it - it's better because it's standardized and date is always full date.

Out of curiosity: can you paste filezilla logs?
Hi,

I have looked at the FileZilla logs but don't see anything usefull..

2017-01-17 12:43:06 10040 1 Status: Retrieving directory listing of "/ba_lve/errors"...
2017-01-17 12:43:06 10040 1 Command: PASV
2017-01-17 12:43:06 10040 1 Response: 227 Entering Passive Mode .
2017-01-17 12:43:06 10040 1 Command: LIST
2017-01-17 12:43:06 10040 1 Response: 150 Opening BINARY mode data connection for file list
2017-01-17 12:43:06 10040 1 Response: 226 Transfer complete
2017-01-17 12:43:06 10040 1 Status: Directory listing of "/ba_lve/errors" successful
2017-01-17 12:43:11 10040 3 Status: Resolving address of ....
2017-01-17 12:43:11 10040 3 Status: Connecting to ...
2017-01-17 12:43:11 10040 3 Status: Connection established, waiting for welcome message...
2017-01-17 12:43:11 10040 3 Response: 220  FTP server ready
2017-01-17 12:43:11 10040 3 Command: AUTH TLS
2017-01-17 12:43:11 10040 3 Response: 234 AUTH TLS successful
2017-01-17 12:43:11 10040 3 Status: Initializing TLS...
2017-01-17 12:43:11 10040 3 Status: Verifying certificate...
2017-01-17 12:43:11 10040 3 Status: TLS connection established.
2017-01-17 12:43:11 10040 3 Command: USER ftp4549
2017-01-17 12:43:11 10040 3 Response: 331 Password required for ftp4549
2017-01-17 12:43:11 10040 3 Command: PASS **********
2017-01-17 12:43:11 10040 3 Response: 230 Anonymous access granted, restrictions apply
2017-01-17 12:43:11 10040 3 Status: Server does not support non-ASCII characters.
2017-01-17 12:43:11 10040 3 Command: PBSZ 0
2017-01-17 12:43:11 10040 3 Response: 200 PBSZ 0 successful
2017-01-17 12:43:11 10040 3 Command: PROT P
2017-01-17 12:43:11 10040 3 Response: 200 Protection set to Private
2017-01-17 12:43:11 10040 3 Status: Logged in
2017-01-17 12:43:11 10040 3 Status: Starting download of /ba_lve/errors/4549aug16_ACB_ABSA_VET2990729_DOReject.TXT.zip
2017-01-17 12:43:11 10040 3 Command: CWD /ba_lve/errors
2017-01-17 12:43:11 10040 3 Response: 250 CWD command successful
2017-01-17 12:43:11 10040 3 Command: PWD
2017-01-17 12:43:11 10040 3 Response: 257 "/ba_lve/errors" is the current directory
2017-01-17 12:43:11 10040 3 Command: TYPE I
2017-01-17 12:43:11 10040 3 Response: 200 Type set to I
2017-01-17 12:43:11 10040 3 Command: PASV
2017-01-17 12:43:11 10040 3 Response: 227 Entering Passive Mode (...).
2017-01-17 12:43:11 10040 3 Command: RETR 4549aug16_ACB_ABSA_VET2990729_DOReject.TXT.zip
2017-01-17 12:43:12 10040 3 Response: 150 Opening BINARY mode data connection for 4549aug16_ACB_ABSA_VET2990729_DOReject.TXT.zip (959 bytes)
2017-01-17 12:43:12 10040 3 Response: 226 Transfer complete
2017-01-17 12:43:12 10040 3 Status: File transfer successful, transferred 959 bytes in 1 second
Me too., I wondered, if they do something differently. It seems they simply perform the check I proposed - if it's in the future, subtract 1 from year. We'll implement this today
Wow guys this sounds fantastic, so realistically when do you think we can expect a newly released DLL etc?
All tests already passed, build is in progress...
New version (2.0.17017.1319) was released:
https://www.limilabs.com/ftp/download
Thanks so much guys will be repping your products to anyone looking for an FTP library that is well supported!

The fix works on my end :)

1 Answer

+1 vote

4 last files have no year specified.

In such case, current year is assumed, so effectively those have modify date set to Aug 2017.

We could probably modify the code a bit, so if the date is in future current year - 1 is used.


New version (2.0.17017.1319) was released:
https://www.limilabs.com/ftp/download

by (301k points)
edited by
Yeah i see they have no year specified, the modifyDate property cannot be assigned is read-only.

Maybe i could do a check on my side to remove any ideas in the list with a modified date > the current date and time since that should be impossible..
...