I'm working on a C++ project where I need to save a lot of data into binary files. The data is generated over time and the program not only reads but also rewrites these files. I understand that fstream read functions don't load the entire file into RAM, which makes me think about the potential complications if I need to delete parts and shift everything to fill the space. I'm considering storing data in separate files, each with a header indicating their creation time, which might make it easier to locate specific data quickly. I'm curious, at what size should I think about creating a new file for better access? Would this method be effective for my needs? Thanks!
1 Answer
Have you thought about using a database instead? If you're planning to create multiple files with headers, that might be a sign to rethink your storage method altogether.
That's a good point! I started off with small data, but now that it's growing, I hadn’t even considered databases. Do you have any solid resources for learning about databases in C++?