harbour / core

Portable, xBase compatible programming language and environment
https://harbour.github.io/
Other
322 stars 207 forks source link

ftp listfiles bug #134

Open sergegirard opened 7 years ago

sergegirard commented 7 years ago

Hello ,

I wish to report a bug in tipclientftp:

Where ListFiles() parses the day from the line ("6" in those cases) around line 849 in ftpcli.prg it finds a single digit.

In line 871 it concatenates the year (4 digits), the month (2 digits where single digit months have already been padl()ed to 2 digits) and the day (which has not been padl()ed to 2 digits) and sends the 7 digit string to hb_stod(). And hb_stod() does not understand the missing 8th digit, so it returns 20161212 when the day is "6" or an empty string when the day is "9", for example. This small example shows what happens when the argument to hb_stod() is incomplete:

? dtos( hb_stod( '2016126' ) )

So the bug is in the day not being padl()ed to 2 digits before building the date string.

vszakats commented 7 years ago

Until this gets fixed, you may be interested in upgrading to hbcurl which does resolve this (and most any) protocol related issues.

Numerabilis commented 2 years ago

Hi, I am having the same error. My program works fine in xHarbour but when I compile with Harbour I got some empty dates. It seems the bug remains until now. Isn´t it already corrected? I don´t know hbcurl, how can I get a directory list with it?

vszakats commented 2 years ago

hbcurl/libcurl can do that, yes: https://everything.curl.dev/libcurl/examples/ftplist

Numerabilis commented 2 years ago

Hi, thanks! I took a look at that example, but it seems to be in C not xBase. I would like to know how could I implement that in Harbour using xBase. Look, I was using xHarbour v1.2.1 and listfiles() is working fine. Could you get that borrowed from xHarbour? I know somethings are borrowed each other among Harbour and xHarbour.