[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: another bug in FTPAPI



Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>

One would need to check wwExists, differeing CCSIDs, etc. and two one of two things: either delete the existing file (the simple solution) or change the CCSID of the file with Qp0lSetAttr (the more elegant way, but

...or to use the CHGATR CL command that I suggested in my prevous message.


CHGATR OBJ('/foo/bar') ATR(*CCSID) VALUE(850)

This does the same thing that Qp0lSetAttr() would do.

requiring more code lines). Oh well, you mentioned that already in your reply, sorry. Anyway, I am willing to implement either, if you tell me your preference.

If you'd like to code the Qp0lSetAttr() API, that'd be my first choice, because I think it'd be the most robust. Put it in a subprocedure called "SetCCSID" or something like that to hide the complexity from the rest of the code.



Speaking of "old and sloppy code"... I have found you pretty often (if not always) append the x'00' to strings yourself (and have to remove it at other times) and pass %addr(string) to the various IFS APIs.I guess that is due to historical reasons, when there was no Options(*String)?

Yes, FTPAPI is very old. It was originally written for V3R2 -- options(*string) was added to the language in V3R7, so it wasn't available to V3R2 programs. I prefer options(*string), and now that V3R2 is no longer supported in FTPAPI, it can be changed to use it.



I would not mind to do some fixing to various procedures, if you tell me which and your general preferences. I would do that as sort of "pay back" for the tremendous help I got from your FTPAPI (btw, I am also in need of the SSL changes; will wait patiently, though).

Unfortunately, the SSL support that Craig Strong contributed to the project assumes that you have only one FTP session, so if you tried to use it with more than one session, it'd cause settings between them to get garbled and probably crash FTPAPI. I could fix it, but I haven't had the time.



Another question: do you still deem it necessary to maintain compatibility to V4R4 (you seem to question it yourself on your web site), or should we move to free form and some neater coding styles, e.g. qualified DS, in new code?

I, personally, don't need V4R4. In fact, one of the problems I have with every release of both FTPAPI and HTTPAPI is that I have no way to test whether they work on old releases like V4R4, since I don't have access to machines that old.


However, there have been thousands of people who downloaded FTPAPI, and I don't know what THEY need....

Oh yes, while we are talking... you mentioned replacing code pages with CCSIDs. Well, I always wanted to ask someone... what's the subtle differences between them? I have to say that I am new to iSeries programming... CCSIDs seem to be very unique to IBM. However, I do not really tackle the difference between code page 819 and CCSID 819? Pardon my ignorance in advance.

A CCSID is a number that identifies an encoding scheme and one or more character set/code page pairs.


In most Western character sets (or, at least, the ones I've worked with) there's only one code page in a CCSID, and the CCSID was given a number that matches the code page. For example, CCSID 819 is also codepage 819. But, this is not always the case in Eastern languages where there can potentially be several code pages used to represent their language. One CCSID is all they need to address all of the required code pages.

At least, that's how I understand it... I'm far from an expert on this topic. Since my company only does business in the United States, and we use the same language (English) throughout the country, I don't get the opportunity to work with lots of different CCSIDs. Most of what I know about them comes from playing around in my spare time :)

You might find this web site to be useful:
http://www-03.ibm.com/servers/eserver/iseries/software/globalization/

(or, like me, you might find it to be confusing!)

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------