× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Cool. That's why you need to post the complete code in the list. :)
Hey, do you have a PGP decryption routine on the 400 or will you just use a
PC-based tool?

-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 9:19 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: IFS STMF file read - Codepage problem? - resolved

Bob/Scott - Thanks!

After I got ErrNo working - it was 3021 - wrong number , so I looked 
closer at the code and I was opening the file using...

        fd = open('/testfile.asc':
                   O_TEXTDATA);

but should have been opening it using...

        fd = open('/testfile.asc':
                   O_RDONLY + O_TEXTDATA);

When I opened it that way - then it opened just fine, and I was able to 
read the first few bytes.


Bob,

The PGP encrypted files that we work with are plain ascii.  The first line 
of each file is...
'-----BEGIN PGP MESSAGE-----                       '

then the encryption version number, then encrypted data.  I'm processing a 
folder that has both plain text reports and encrypted PGP files.  So I was 
reading the folder and then the first few bytes of each file to decide if 
the file needed to decrypted.


Thanks for your help guys.


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 09:08 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?






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 thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.