Am Sonntag, 21. Dezember 2014, 18:30:28 schrieb Eli Zaretskii: > > From: Tim Rühsen <[email protected]> > > Date: Sun, 21 Dec 2014 13:13:50 +0100 > > > > > > The .listing file can't be parsed correctly when the month names are > > > > incorrect. > > > > > > I see. But then this is not the problem in my case. Here's the > > > > > > listing I see in one of the FTP test logs: > > > 226 Listing complete. Data connection has been closed. > > > -r--r--r-- 1 0 0 12 Dec 12:43 franτais.txt > > > 2014-12-19 12:43:03 (362 KB/s) - '.listing' saved [48] > > > > > > As you see, even though the file name includes non-ASCII characters, > > > the month name is in English (which is what I'd expect, given the > > > locale I have here). > > > > > > > But I know, there are a few Windows users / developers reading this. > > > > Maybe they can help or bring some light !? > > > > > > I certainly hope so. > > > > > > Could the problem be that the listing has a CR-LF end-of-line format? > > > Could that interfere with its parsing? > > > > > > Thanks. > > > > Back to Test-ftp-bad-list.px... if you add the following line to > > FTPServer.pm, you can see the difference between the GNU/Linux and the > > Windows .listing. The listing has two lines, so a difference of 4 bytes > > (reported in your original post) seems not to be a CRLF problem. > > Right you are. I looked at it from the other end: enabled debugging > output from wget, and then looked carefully at the output. And I saw > this: > > .listing [ <=> ] 88 --.-KB/s in 0s > > Closed fd 4 > 226 Listing complete. Data connection has been closed. > 2014-12-21 18:16:05 (693 KB/s) - '.listing' saved [88] > > PLAINFILE; perms 444; size: 0; month: Dec; day: 18; time: 00:00:00 (no > yr); Skipping. > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ > PLAINFILE; perms 444; size: 0; month: Dec; day: 18; time: 00:00:00 (no > yr); Skipping. > Removed '.listing'. > > Which then prompted me to take a closer look at the listing wget > receives as result of LIST: > > -r--r--r-- 1 0 0 12 Dec 18:17 afile.txt > ^^^^^^^ > Look, ma: no day of the month!
Outch !
>
> And that leads me to this line in FTPServer.pm:
>
> my $date = strftime("%b %e %H:%M", localtime);
>
> Which is the root cause of the problem: it uses %e, which is a C99
> feature, and is not supported on MS-Windows. I replaced it with %d,
> and now all the FTP tests succeed!
Thanks for testing, I'll set up a patch for using %d.
%e is not C99 but Single Unix Specification.
And Windows / MS doesn't care for it.
FYI, see http://msdn.microsoft.com/en-us/library/fe06s4ak.aspx
I normally never use strftime in my applications, now I remember one of the
reasons ;-).
> P.S. Now I'm beginning to wonder whether anyone runs the test suite on
> Windows, or cares about the results...
Looks like nobody does :-(
Tim
signature.asc
Description: This is a digitally signed message part.
