lundi 16 mars 2015

RAM consumption on opening a file


I have a Binary file of ~400MB which I want to convert to CSV format. The output CSV file will be ~1GB (according to my calculations).


I read the binary file and store it in an array of structures (required for other processing too), and when the user wants to export it to CSV, I am creating a file (or opening an existing file - depending on the user's choice), opening it using fopen and then writing to it using fwrite, line by line. Coming to my question, this link from CPlusPlus.com says:



The returned stream is fully buffered by default if it is known to not refer to an interactive device



My query is when I open this file, will it be loaded in RAM? Like when at the end, my file is of ~1GB, will it consume that much RAM or will it be just on the hard disk?


This code will run on Windows as well as Android.




Aucun commentaire:

Enregistrer un commentaire