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



You realize that if you use fread(), all the buffering is handled invisibly for you? You just read however many bytes you want at any one time.

That *is* the advantage of using fread(), fwrite(), fopen() etc.

-Paul
?

-----Original Message-----
From: Adam Glauser [mailto:adamglauser@xxxxxxxxx]
Sent: Thursday, February 5, 2009 07:44 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Buffered reading of stream files

Simon, you are correct that I am currently using the open(), read() and close() Unix APIs.Simon Coulter wrote:> Whether you do your own buffering or use the OS buffering you'll still > have to deal with incomplete data where you have part of the desired > data in the buffer but the buffer is full. Dealing with this situation > may be easier when you control the buffering.That's a good point, which I realized on the drive home last night. I think I came up with a reasonable solution using fread() which will be simpler than handling all of the buffering. I'm planning to put together a prototype and compare with my existing routine today.-- This is the RPG programming on the IBM i / System i (RPG400-L) mailing listTo post a message email: RPG400-L@xxxxxxxxxxxxxx subscribe, unsubscribe, or change list options,visit: http://lists.midrange.com/mailman/listinfo/rpg400-lor email: RPG400-L-request@xxxxxxxxxxxxxxxxxx posting, please take a moment to review the archivesat http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.