|
Are you creating the file with O_CREAT and at the same time assigning O_TEXTDATA and O_CODEPAGE? If so, that's the problem. When you open a file with O_TEXTDATA it translates whatever the codepage on the file is... however, if the file doesn't exist, no code page has been assigned, so no translation is done. When you use O_CODEPAGE, you are assigning a code page... OS/400 thinks that the data you're writing to that file will already be in that code page, and that's why you're assigning that. For example, if you were writing an HTTP client (since I know yu've done this) and you've asked the server for a codepage, you'd tell the AS/400 that codepage. You wouldn't want the data translated, because you'd be receiving it on the socket already in that page. And, that's what OS/400 thinks is happening... The solution is pretty simple. First create the file with O_CREAT & O_CODEPAGE, then close() it and open it again. This time with O_TEXTDATA. Since the file already exists, and already has a code page, the system will automatically translate for you. Good Luck! On Mon, 28 Oct 2002, Brad Stone wrote: > I am creating an IFS file with an RPG program. I am > specifying the file as text data, code page 819. > > If I use WRKLNK to view the file, it looks great. If I try > and use FTP to download the file, it's all garbage on my PC. > > can anyone explain why? :) > > I'm having a little brain fry today... > > Brad
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.