Opened 13 years ago

Closed 10 years ago

#7219 closed Bug report (rejected)

Change from HOUR to YEAR date format too early

Reported by: Bieringer Dominik Owned by:
Priority: low Component: FileZilla Server
Keywords: Cc:
Component version: Operating system type:
Operating system version:


When requesting a directory listing from the FileZilla FTP Server, files that were modified very recently are listed with the HOUR and MINUTE fields; files that were modified long time ago are instead listed with the YEAR field.

Normally FTP servers change the format after about a year, which is - as far as I have understood - also the intended way the FileZilla FTP Server should work (see the comment in ticket #1317).

However, this is not the case, as the corresponding code does compare the difference between the current date and the file date wrongly; the related code in Permissions.cpp:

 256     pResult->len += sprintf(pResult->buffer + pResult->len, " %s %02d ", months[sFileTime.wMonth-1], sFileTime.wDay);
 257     if (t1 > t2 || (t2-t1) > ((_int64)1000000*60*60*24*350))
 258         pResult->len += sprintf(pResult->buffer + pResult->len, " %d ", sFileTime.wYear);
 259     else
 260         pResult->len += sprintf(pResult->buffer + pResult->len, "%02d:%02d ", sFileTime.wHour, sFileTime.wMinute);

t2 and t1 are values of type FILETIME (see, which stores the time in 100-nanosecond intervals. As a nanosecond is 10-9s, which is 1 000 000 000, a value of 10 000 000 in a TIMESTAMP equals one second.

Therefore the comparison should read like 10 000 000*60*60*24*350 instead of 1 000 000*60*60*24*350.

With the current code, FileZilla changes the format of the listing after 35 days (because of the missing zero).

Change History (2)

comment:1 by Tim Kosse, 13 years ago

Priority: criticallow

The output of LIST is entirely undefined by the FTP specifications. As such, the way FileZilla displays the time only for this short of a time can be considered compliant with the specifications. As such, dropping priority to low.

You may want to upgrade to a modern client that makes use of the MLSD command, which requires timestamps to always include seconds regardless of age.

For future versions of FileZilla Server, I consider simply mapping LIST to MLSD.

comment:2 by Tim Kosse, 10 years ago

Resolution: rejected
Status: newclosed
Note: See TracTickets for help on using tickets.