fopen and memory usage

Cameron Simpson cs at zip.com.au
Tue Sep 25 22:43:24 UTC 2007


On 25Sep2007 17:01, aragonx at dcsnow.com <aragonx at dcsnow.com> wrote:
| I was wondering.  If I have a large log file and I use fopen to write to
| it, does it load the entire file into memory before I can write?  If not,
| how do I know how much memory I am wasting opening that file?

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.
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

Anarchy may not be the best form of government, but it's better than no
government at all.




More information about the users mailing list