+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)
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..
...