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



Hi Aaron,

Isn't the 1024th byte 90?

Regards

Paul Tuohy
ComCon
www.comconadvisor.com www.systemideveloper.com




Aaron Bartell wrote:
I have an IFS file reading issue that I can't quite figure out. The
general idea is that I want to incorporate a process of streaming an IFS
file from one place to the next in chunks of 1024 vs. reading it with a
single call to read() after first allocating space based on the file size.

The scenario is as follows: I have a file named small.jpg in the IFS that
is 1067 bytes in size. When I read in 1024 bytes the 1024th byte is
different than when I read in all 1067 bytes at a time. The 1024th byte
when I read 1024 at a time is x'AF' (which appears as the Registered
symbol) and the 1024th byte when I read in the entire file of 1067 bytes
is x'94' (a lower case letter m). Crazy eh?

Here are some screen shots of the memory differences (highlighted) in
WDSC's Memory view:
[1]http://mowyourlawn.com/temp/readbyteissue_dataptr1.png
[2]http://mowyourlawn.com/temp/readbyteissue_dataptr2.png

Here is the concise program I put together to test the issue:
[3]http://mowyourlawn.com/temp/READBYTE.RPGLE

Here is the small.jpg file I am using in the test.
[4]http://mowyourlawn.com/temp/small.jpg

Anybody have any ideas of what might be going on? Am I missing something
stupid?

Aaron Bartell
[5]http://mowyourlawn.com

References

Visible links
1. http://mowyourlawn.com/temp/readbyteissue_dataptr1.png
2. http://mowyourlawn.com/temp/readbyteissue_dataptr2.png
3. http://mowyourlawn.com/temp/READBYTE.RPGLE
4. http://mowyourlawn.com/temp/small.jpg
5. http://mowyourlawn.com/

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.