|
How are you testing the first few bytes to see if it is encrypted? Why not just open the file as binary (like you already are) then convert the data to your job's CCSID then "test the first few bytes"? O_TEXTDATA automatically converts the IFS file's codepage to the job's codepage, but it can only do that effectively with plain ASCII text. It also adds linefeed characters to the data, so the data will not be the same as it is on the IFS when read by O_TEXTDATA. I use O_TEXTDATA only for text files. Perhaps O_TEXTDATA is detecting something in the file that prohibits it from being able to read the file as plain ascii text and is giving you an error on the open or read. -Bob Cozzi www.RPGxTools.com If everything is under control, you are going too slow. - Mario Andretti -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of jstevens@xxxxxxxxxxxxxx Sent: Friday, July 01, 2005 8:56 AM To: RPG programming on the AS400 / iSeries Subject: RE: IFS STMF file read - Codepage problem? But I'm not sure that it needs to be decrypted at the point that I'm reading the file. I'm reading the first few bytes to find out if the file is encrypted or not. (still working on the error number - should have it soon)... Thanks! Jeff Stevens Mize, Houser & Co. P.A. 913 451 1882 JStevens@xxxxxxxxxxxxxx "Bob Cozzi" <cozzi@xxxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx 07/01/2005 08:51 AM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> To "'RPG programming on the AS400 / iSeries'" <rpg400-l@xxxxxxxxxxxx> cc Subject RE: IFS STMF file read - Codepage problem? You can open non-"plain" ASCII with O_TEXTDATA? Hmmm? I don't think he should be reading the file as O_TEXTDATA, but rather, read it as binary, decrypt it, then convert the decrypted text which should at that point be in ASCII or CCSID 437 (8-bit ASCII US PC) to EBCDIC. -Bob Cozzi www.RPGxTools.com If everything is under control, you are going too slow. - Mario Andretti -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement Sent: Thursday, June 30, 2005 5:10 PM To: RPG programming on the AS400 / iSeries Subject: Re: IFS STMF file read - Codepage problem? >> EVAL data:x > 00000 2D2D2D2D 2D424547 494E2050 4750204D - .....âáåñ+.&å&.( > 00010 45535341 47452D2D 2D2D2D40 40404040 - áëë åá..... > 00020 40404040 40404040 40404040 40404040 - > 00030 4040.... ........ ........ ........ - .............. > On the code page 437 - the file attributes say that it's a codepage of > 437. Yep, that looks like valid ASCII. You need to get O_TEXTDATA working, somehow. Please let us know what the value of "errno" is when you find out.
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.