[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FTPAPI codepage problem with ftp_list (or ftp_dir)
Sender: Christian <chrisv5@xxxxxx>
I found and fixed the culprit. First, let me repeat the problem in
question. Assume the following code (simplified):
rc = ftp_binarymode(SessID: *off);
rc = ftp_codepage(SessID: 00819: 00819);
rc = ftp_list(SessID: '': cMaxFiles: %Addr(RmtFiles): NbrRmtFiles);
If (NbrRmtFiles > cMaxFiles);
NbrRmtFiles = cMaxFiles;
EndIf;
For I = 1 to NbrRmtFiles;
WrkFileName = %Trim(RmtFiles(I));
rc = ftp_get(SessID: WrkFileName: WrkLclDir + WrkFileName);
NbrFiles = NbrFiles + 1;
EndFor;
The above will not work, cause the file list is packed into the first
few array entries. The reason is that bufline() cannot find the CRLF.
The bug is actually in get_byline() though.
c eval wwCrLf = x'0D25'
B01 c if wkBinary = *Off
c callp ToASCIIF(wwCrLf:2)
E01 c endif
should really be this:
B01 c if wkBinary = *Off
B02 c if wkXLatHack = *on
c callp ToASCII(wwCrLf:2)
X02 c else
c callp ToASCIIF(wwCrLf:2)
E02 c endif
E01 c endif
Scott, could you please put that into your distribution?
Cheers,
Christian
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------