[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: fopen and memory usage



> No, it doesn't. What purpose would that serve?  It will cost you a buffer
> for the I/O (perhaps 8192 bytes) and a FILE control structure.

If I remember rightly its nearer 64K nowdays simply because disks are
faster, memory is cheaper and its a good buffer size.

Basically the C library will make an intelligent decision on buffering
which you should assume is right exept in very special cases. That value
may change depending on library version, kernel, system memory, OS and a
million other things but its there in the library to save you having to
worry about it in the app.

If you need to do specific buffering see "man setbuf"

Alan


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]