Problem with FTP

Problem with FTP

Postby Maurizio » Thu Apr 17, 2008 3:18 pm

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
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Postby vilian » Thu Apr 17, 2008 8:28 pm

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
vilian
 
Posts: 975
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Postby Maurizio » Fri Apr 18, 2008 6:27 am

Thank Vilian
but the problem remain

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

Postby Antonio Linares » Fri Apr 18, 2008 12:04 pm

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
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Maurizio » Fri Apr 18, 2008 12:11 pm

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
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Postby Antonio Linares » Fri Apr 18, 2008 12:30 pm

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
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Maurizio » Fri Apr 18, 2008 12:48 pm

Antonio,

< Have you modified that function ?

absolutely no

MAurizio
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Postby Antonio Linares » Fri Apr 18, 2008 1:01 pm

Maurizio,

Lets modify the source code to check whats going on:
Code: Select all  Expand view
   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
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Maurizio » Fri Apr 18, 2008 2:33 pm

Antonio ,

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

Regards MAurizio
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Postby Antonio Linares » Fri Apr 18, 2008 7:45 pm

Maurizio,

Please add this code to your main PRG and try it again, thanks:
Code: Select all  Expand view
#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
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Maurizio » Sat Apr 19, 2008 5:56 am

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
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Postby Antonio Linares » Sat Apr 19, 2008 7:09 am

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
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Maurizio » Mon Apr 21, 2008 8:12 am

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
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Postby Antonio Linares » Mon Apr 21, 2008 8:13 am

Maurizio,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Marco Turco » Wed Apr 23, 2008 10:58 am

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
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 74 guests