On 11 Dec 2006, at 21:12, Menneteau wrote:
Theodore H. Smith wrote:
On 11 Dec 2006, at 20:26, Menneteau wrote:
Thanks Mennetau, nice answer.
One more though. What is the difference between fopen and open?
Why is there an fopen call when open seems to do it all, and even
better? Is fopen better buffered, or what?
fopen is a higher level call that gives you access to higher level
calls
such as fgets/fgetws (get string/wstrinf from afile) that you don"t
get with read.
Anyhow, for my case, I don't want any buffering.
Do you have any idea how I can ask the OS what is it's preferred
file I/O read/write size?
perhaps with sysctl. For example, you can get the software page
size and any I/O operation is a multiple of that value
Unfortunately, that just tells me 4096, which to be honest, is a kind
of sucky buffer size ;)
I was thinking more about the disk block read size. When people are
doing speed tests on their hard disks, what kind of chunk size do
they read/write? Isn't the best speed around 16MB chunks?
XBench for example, reports that reading in 256KB blocks gives me
about 2x the speed of doing it in 4KB blocks.
Bah.
I may have to just leave the block size settable by the user, and
give a nice handy guess, and hope the user's guess isn't even worse
than mine ;)
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>