Problem with FTP

User avatar
Maurizio
Posts: 705
Joined: Mon Oct 10, 2005 1:29 pm
Contact:

Problem with FTP

Post by Maurizio »

Hello Antonio

I have this problems with oFtp:Directory

With FW7.07 I used
aFiles = oFTP:Directory( "filelist\01\")
and works

Now with FW 8.03 I have this error
Error description: Error BASE/1066 Parametro errato: condizionale

Thank MAurizio
User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Post by vilian »

Hi Maurizio,

Change

aFiles = oFTP:Directory( "filelist\01\")

to

aFiles := oFTP:Directory( "filelist\01\")
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
Maurizio
Posts: 705
Joined: Mon Oct 10, 2005 1:29 pm
Contact:

Post by Maurizio »

Thank Vilian
but the problem remain

Maurizio
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Maurizio,

Please compile source\classes\tftp.prg as another PRG of your application and check in what line number the error is generated, thanks

My guess is that the error is coming from here:
while InternetFindNextFile( hFTPDir, @cBuffer )
but just to be sure
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Maurizio
Posts: 705
Joined: Mon Oct 10, 2005 1:29 pm
Contact:

Post by Maurizio »

Antonio

Yes the error is at the line

while InternetFindNextFile( hFTPDir, @cBuffer )

I have the first file with
hFTPDir = FtpFindFirstFile( ::hFTP, cMask, @cBuffer, 0, 0 )




Regards MAurizio
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Maurizio,

InternetFindNextFile( hFTPDir, @cBuffer ) should return a logical value. Its real strange that it is not returning it.

Have you modified that function ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Maurizio
Posts: 705
Joined: Mon Oct 10, 2005 1:29 pm
Contact:

Post by Maurizio »

Antonio,

< Have you modified that function ?

absolutely no

MAurizio
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Maurizio,

Lets modify the source code to check whats going on:

Code: Select all

   local lResult
   ...

         while ValType( lResult := InternetFindNextFile( hFTPDir, @cBuffer ) ) == "L" .and. lResult
            oWin32FindData:cBuffer = cBuffer
            AAdd( aFiles, { oWin32FindData:cFileName,;
                            oWin32FindData:nSizeLow,;
                            FileTimeToDate( oWin32FindData:nLastWriteAccess ),;
                            FileTimeToTime( oWin32FindData:nLastWriteAccess ) } )
         end
Thanks for your feedback,
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Maurizio
Posts: 705
Joined: Mon Oct 10, 2005 1:29 pm
Contact:

Post by Maurizio »

Antonio ,

With your modify the programm work
but in aFiels I have only the first file .

Regards MAurizio
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Maurizio,

Please add this code to your main PRG and try it again, thanks:

Code: Select all

#pragma BEGINDUMP
#include <hbapi.h>
#include <windows.h>
#include <wininet.h>

HB_FUNC( INTERNETFINDNEXTFILE )
{
   hb_retl( InternetFindNextFile( ( HINTERNET ) hb_parnl( 1 ), 
                              ( LPWIN32_FIND_DATA ) hb_parc( 2 ) ) );
}
#pragma ENDDUMP
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Maurizio
Posts: 705
Joined: Mon Oct 10, 2005 1:29 pm
Contact:

Post by Maurizio »

Antonio ,

Thank I add the function HB_FUNC( INTERNETFINDNEXTFILE )
and it works .

I compare it with the one in wininetx.c and it's the same ???

What is strange is that when I have a error instead to have the error list of FW I had the list of xHArbour , maybe the problem is related ?



Thank Maurizio
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Maurizio,

wininetx.c has not been placed inside FiveHC.lib yet. Instead we are still using source\winapi\wininet.prg

Please run samples\TestErro.prg. You should get FWH error dialog box, unless you have modified the errorsys yourself or you are linking the libraries in a different order, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Maurizio
Posts: 705
Joined: Mon Oct 10, 2005 1:29 pm
Contact:

Post by Maurizio »

Antonio ,
there is a same pronblem with
oFtp:DeleteFile

I insert :
HB_FUNC( FTPDELETEFILE )
{
hb_retl( FtpDeleteFile( ( HINTERNET ) hb_parnl( 1 ), hb_parc( 2 ) ) );
}

And now work

Regards MAurizio
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Maurizio,

We need to remove wininet.prg and add wininetx.c
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Marco Turco
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London
Contact:

Post by Marco Turco »

Hi Antonio,
I have the same problem using the FTP functions.

Do you already have an updated lib that fix it ?

Thanks
Best Regards,

Marco Turco
SOFTWARE XP LLP
Post Reply