|
Yes, probably. You're not openning the file as a TEXT file, so I don't believe the system automatically converts it to CCSID(37) for you. Although, think about it... why would you want it to be converted? Perhaps convert just the first 5 bytes or so and see if it is GIFxx then you'll know. Or copy that data to a field and convert the field, if you intend to leave it in the original format anyway. > -------- Original Message -------- > Subject: Reading IFS bin file into an RPG variable > From: Kyle Collie <kcollie@xxxxxxxxx> > Date: Sat, January 21, 2006 10:16 am > To: RPG List <rpg400-l@xxxxxxxxxxxx> > > I have this code snippet: > > <code> > > @temp = %addr(temp); > nbyte = %size(temp); > fd = open(%trim(pr_path):O_RDONLY); > if fd < 0; > pr_status = %char(errno); > EscErrno(errno); > endif; > > // read the file into a var > i = read(fd:@temp:nbyte); > if i < 0; > pr_status = %char(errno); > EscErrno(errno); > endif; > > </code> > > If I do a wrklnk on an IFS file, I see this: > > GIF89a ÷ ÿÿÿðíîGFG... > > But in debug, my temp variable contains this: > > åñã / 7 0ÒÓåãå x¿ÝzÞ^xÐÞ ~xzwÝ(r) (í ... > > Not nearly the same. > > What am I missing? If is a codepage issue? > > Kyle > > -- > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/rpg400-l > or email: RPG400-L-request@xxxxxxxxxxxx > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.