oFtp:Directory() 32 bit doesn't work

Post Reply
marzio
Posts: 193
Joined: Wed Apr 04, 2007 6:54 am

oFtp:Directory() 32 bit doesn't work

Post 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)

User avatar
Enrico Maria Giordano
Posts: 9054
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

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

Post 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
marzio
Posts: 193
Joined: Wed Apr 04, 2007 6:54 am

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

Post 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.

User avatar
Enrico Maria Giordano
Posts: 9054
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

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

Post 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
marzio
Posts: 193
Joined: Wed Apr 04, 2007 6:54 am

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

Post 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

User avatar
Enrico Maria Giordano
Posts: 9054
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

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

Post by Enrico Maria Giordano »

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

marzio
Posts: 193
Joined: Wed Apr 04, 2007 6:54 am

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

Post 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

Last edited by marzio on Tue Apr 14, 2026 7:30 pm, edited 2 times in total.
User avatar
Enrico Maria Giordano
Posts: 9054
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

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

Post by Enrico Maria Giordano »

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

marzio
Posts: 193
Joined: Wed Apr 04, 2007 6:54 am

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

Post by marzio »

where can i find the april 2026 version?

User avatar
alerchster
Posts: 154
Joined: Mon Oct 22, 2012 4:43 pm

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

Post by alerchster »

Regards

Ing. Anton Lerchster
Post Reply