Page 1 of 1

oFtp:Directory() 32 bit doesn't work

Posted: Tue Apr 14, 2026 2:40 pm
by marzio

hi at all.

The oFtp:Directory() function to obtain an array of remote files (with size, date, time, attributes)
only works in the 64-bit version (FiveWin 25.01 - harbour vC22). When compiled for 32-bit, it crashes the program.
any idea?

FUNCTION aRemoteFile()

LOCAL oInternet, oFtp, aFileRem

oInternet := tInternet():New()
IF oInternet:hSession != 0
oFtp := tFtp():New("ftp......it", oInternet, "[email protected]", cPassWord, 134217728)

IF oFtp:hFTP != 0
aFileRem := oFtp:Directory("......it/download/.")
oFtp:End()
ENDIF

oInternet:End()
ENDIF

Return(aFileRem)


Re: oFtp:Directory() 32 bit doesn't work

Posted: Tue Apr 14, 2026 4:09 pm
by Enrico Maria Giordano

Try to remove the member dummy from here (tftp.prg):

Code: Select all | Expand

   STRUCT oWin32FindData
      MEMBER nFileAttributes  AS DWORD
      MEMBER nCreationTime    AS STRING LEN 8
      MEMBER nLastReadAccess  AS STRING LEN 8
      MEMBER nLastWriteAccess AS STRING LEN 8
      MEMBER nSizeHight       AS DWORD
      MEMBER nSizeLow         AS DWORD
      MEMBER nReserved0       AS DWORD
      MEMBER nReserved1       AS DWORD
      MEMBER cFileName        AS STRING LEN 260
      MEMBER cAltName         AS STRING LEN  14
      MEMBER dummy            AS STRING LEN  50
   ENDSTRUCT

Re: oFtp:Directory() 32 bit doesn't work

Posted: Tue Apr 14, 2026 4:44 pm
by marzio

i have disabled the Dummy from tFtp.prg but does NOT resolve the problem.
i had try to add MEMBER cBuffer AS STRING LEN 260 but i have the same result.


Re: oFtp:Directory() 32 bit doesn't work

Posted: Tue Apr 14, 2026 5:14 pm
by Enrico Maria Giordano

This is working fine for me, without any changes to FWH source code:

Code: Select all | Expand

#include "Fivewin.ch"


FUNCTION MAIN()

LOCAL oInternet := TInternet():New()

LOCAL oFtp := TFtp():New( "ftp.emagsoftware.it", oInternet, cUserName, cPassword )

LOCAL aDir

? oFtp:SetCurrentDirectory( "/emagsoftware.it" )

aDir = oFtp:Directory( "*.*" )

? LEN( aDir )

oFtp:End()

oInternet:End()

RETURN NIL

Re: oFtp:Directory() 32 bit doesn't work

Posted: Tue Apr 14, 2026 6:38 pm
by marzio

i have tried your code but at 32 bit does NOT works FINE for me.
WITH 64 BIT VERSION ALL WORKS FINE.
Could the problem be caused by harbour?
Is there another class with Directory() function?

THANKS


Re: oFtp:Directory() 32 bit doesn't work

Posted: Tue Apr 14, 2026 7:05 pm
by Enrico Maria Giordano

Tested with Harbour 32 bit: works fine too. Please use latest Harbour distribution and latest FWH, if you can.


Re: oFtp:Directory() 32 bit doesn't work

Posted: Tue Apr 14, 2026 7:22 pm
by marzio

I replaced the 32-bit harbor folder with the latest version downloaded from the site (May 2025),
and now everything works fine.

Thank you very much Enrico


Re: oFtp:Directory() 32 bit doesn't work

Posted: Tue Apr 14, 2026 7:28 pm
by Enrico Maria Giordano

Great! But the latest is of April 2026. I recommend to update.


Re: oFtp:Directory() 32 bit doesn't work

Posted: Tue Apr 14, 2026 8:01 pm
by marzio

where can i find the april 2026 version?


Re: oFtp:Directory() 32 bit doesn't work

Posted: Tue Apr 14, 2026 8:12 pm
by alerchster