Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
13.9k views
in .NET FTP by
Hello.

I'm using function FTP.DirDetails(dir) to receive the list of files from remote host. This works perfect, but I saw that the date "LastModified" is incorrect!
If the real date of the last file modification is "28.10.2004 11:00", that edtftpnet returns the date "28.10.2005 11:00"! It's changing only the Year!

How to fix this problem?

Thanx. And sorry for my bad English.

18 Answers

0 votes
by (300 points)
I'd guess thad a dir in linux doesn't seem to send back the "year" component and when building the datetime, the current year is taken by default.
The dir on windows side give the year as it looks.
0 votes
by
Dir doesn't return a year, but quote mdtm does...

ftp>
ftp> dir radacct-log.log.150.gz
200 PORT command successful
150 Opening ASCII mode data connection for file list
-rwxr-xr-x 1 root root 12773 Dec 17 23:51 radacct-log.log.150.gz
226 Transfer complete.
ftp: 79 bytes received in 0.02Seconds 3.76Kbytes/sec.
ftp>
ftp> quote mdtm radacct-log.log.150.gz
213 20041217235158
ftp>

Cheers
0 votes
by
Would it be possible to have an update on the issue?

Cheers
0 votes
by (162k points)
It is problematic as some servers use a 6 month window to not display the year, and some use 12 months. We will look at perhaps adding a method to allow either to be set.

We won't be able to get a fix out immediately, but hope to for the next release in a couple of weeks.

Would it be possible to have an update on the issue?

Cheers
0 votes
by
thanks for that
0 votes
by
An easy way to hack around the problem is insert this into your code on the application side.

FTPFile[] myFile = myFTP.DirDetails(PathFile);

for(int i=0;i<myFile.Length;i++)
{
myDateTime = myFile[i].LastModified;
if(myDateTime > DateTime.Now)
//If the file's date is a future date then that date is off by one
//year due to a bug in the FTP class that deals with how dates
//are displayed in FTP (Ex: if a file is more than a year old it
//will display the year in a column, otherwise it will display
//the time in that column).
myDateTime = myDateTime.AddYears(-1);
}

Also if you are planning on releasing another version soon, will the problem in this thread also be addressed?
http://www.enterprisedt.com/forums/viewtopic.php?t=502
0 votes
by (162k points)
Yes, this will be addressed in the next version. You can expect it in a week or so.

Also if you are planning on releasing another version soon, will the problem in this thread also be addressed?
http://www.enterprisedt.com/forums/viewtopic.php?t=502
0 votes
by (162k points)
1.1.7 is now released. Hopefully fixes the year/date problem and the problem in the thread below. Enjoy.

http://www.enterprisedt.com/products/ed ... nload.html

Yes, this will be addressed in the next version. You can expect it in a week or so.

Also if you are planning on releasing another version soon, will the problem in this thread also be addressed?
http://www.enterprisedt.com/forums/viewtopic.php?t=502

Categories

...