I do not know how those api work. However, it looks strange for me to
see %trim(BufOut) being used when attempt to use api to send the data.
Use of %trim would alter the data, which breaks the rule of sending the
data as it.
For example, if BufOut contains a string that happen to have leading
blanks, the %trim will strip them out before api sending it.
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
sodonnell@xxxxxxxxxxxxxxxxxxxxxxxxx
Sent: Wednesday, November 28, 2007 2:28 PM
To: RPG400-L@xxxxxxxxxxxx
Subject: Re: Send_File API versus Send API over a Socket
Using FTP is not an option for this particular application.
Looking at the data a little closer in a tool that compares two
files...if I look at the data from a copy of the image file that I FTP
to the PC and compare it to the one sent over the socket, I can see
where there is a bunch of blank spaces inserted into my file, and it
looks like possibly a carriage return or line feed is being inserted
there too.
It has to be a buffer length issue or something like that.
Here's the relevant bit of code:
The variable bufOut is 32,767 bytes long (character field)
D ifsReadLine PR * ExtProc('_C_IFS_fgets')
D inBuffer * Value Options(*String)
D inBufLen 10i 0 Value
D inFilePtr * Value Options(*String)
*------------------------------------------------------------
C Dow ifsReadLine(%Addr(BufOut):
C %Size(BufOut):zp) <> *NULL
C callp(e) SendtheData(socketDescriptor:
%Trim(BufOut))
C Eval BufOut = *Blanks
C Enddo
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.