× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Greg., been traveling without my laptop ( known as holidays ) so sorry for the late reply.
In ftpapi there are callback functionality built in for logging , see ftpapi.exitproc.
I've been using it long time ago like:

for x = 1 to p.ftpcount;
p.handle( x ) = ftp_open( %trimr( p.ipadress( x )): p.ftpport( x ));
if p.handle( x ) < 0;
wxerr = FTP_errorMsg( 0: errnum );
errtxt = 'Error on ftp_open: ' + %trimr( wxerr ) + ' > ' +
%trim( %editc( errnum:'M' )) + ' for ' + %trimr( p.ipadress( x ));
complain( thisp: errtxt );
return *on;
endif;

// Register exit procedure for logging purposes

ftp_exitProc( p.handle( x ): FTP_EXTLOG: %paddr('LOGFTPP'): *null );

// Login to put session

if ftp_login( p.handle( x ): %trimr( p.account( x )): %trimr( p.password( x )) ) < 0;
wxerr = FTP_errorMsg( p.handle( x ): errnum ) + ' > ' + %trim( %editc( errnum:'M' ));
errtxt = 'Error on ftp_login: ' + %trimr( p.account( x )) + ' ' + %trimr( wxerr );
complain( thisp: errtxt );
for x = 1 to p.ftpcount;
ftp_quit( p.handle( x ));
endfor;
return *on;
endif;

// Set passive mode if specified

if p.passive( x );
if ftp_passiveMode( p.handle( x ): *on ) < 0;
wxerr = FTP_errorMsg( p.handle( x ): errnum ) + ' > ' + %trim( %editc( errnum:'M' ));
errtxt = 'Error on ftp_passiveMode ' + %trimr( wxerr );
complain( thisp: errtxt );
for x = 1 to p.ftpcount;
ftp_quit( p.handle( x ));
endfor;
return *on;
endif;
endif;

// Force Binary mode for pdf files

if ftp_binaryMode( p.handle( x ): *on ) < 0;
wxerr = FTP_errorMsg( p.handle( x ): errnum ) + ' > ' + %trim( %editc( errnum:'M' ));
errtxt = 'Error on ftp_binaryMode ' + %trimr( wxerr );
complain( thisp: errtxt );
for x = 1 to p.ftpcount;
ftp_quit( p.handle( x ));
endfor;
return *on;
endif;
endfor;

<------>

// *===============================================================
// * Logftpp Log ftp events put session +
// *===============================================================
dcl-proc Logftpp;
dcl-pi Logftpp;
peMsgTxt char( 256 ) const;
peLogFile int( 10 );
end-pi;

dcl-c thisp 'LogFtpP';

tell( thisp: peMsgTxt: 5 ); ( writes peMsgTxt to a streamfile )

end-proc;




Best regards



Stefan



--

No trees were killed in the sending of this message, but a large number of electrons were terribly upset.



Stefan Tageson

+46 732 369934

stefan@xxxxxxxxxx<mailto:stefan@xxxxxxxxxx>





________________________________
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> on behalf of Greg Wilburn <gwilburn@xxxxxxxxxxxxxxxxxxxxxxx>
Sent: Tuesday, December 16, 2025 16:16
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: FTPAPI

I use Scott's LIBFTP (FTPAPI) occasionally instead of an FTP Script when exchanging data.

I would like to have a simple "text" log on the IFS for each FTP session.
With a script, I override OUTPUT to a PF in QTEMP, then using CPYTOIMPF to create the text file.
(As CYA, I typically have DIR or LS in the script before I get and remove files)

With FTPAPI, the logging can go to the joblog by enabling FTP Logging. So, I'm considering using CPYSPLF to send the entire joblog to the IFS.
Just wondering if anyone has done something similar?

TIA,
Greg
[Logo]<https://www.totalbizfulfillment.com/> Greg Wilburn
Director of IT
301.895.3792 ext. 1231
301.895.3895 direct
gwilburn@xxxxxxxxxxxxxxxxxxxxxxx<mailto:gwilburn@xxxxxxxxxxxxxxxxxxxxxxx>
1 Corporate Dr
Grantsville, MD 21536
[http://www.totalbizfulfillment.com<http://www.totalbizfulfillment.com>]www.totalbizfulfillment.com<http://www.totalbizfulfillment.com>
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.