I am processing files of our SAN, to minimize network load and load on the SAN (it is an issue in my enviornment) I want to cache the entire file to memory when it's opened. Writing my own file class is what I'm doing right now, but I am finding out how much of a pain it is. The file is part ASCII and part binary
Questions:
1:Is there a way to make the STL fstream chache the entire file upon opening, if so how can I read a line w/ get line containing bad characters like \0
2:Is there another tested solution already out there that anyone can recommend ?
3
o you have any implementation tips right now im using a std::list of a
to hold the file
are there any tips or gotchas i should be aware of?
WR
Questions:
1:Is there a way to make the STL fstream chache the entire file upon opening, if so how can I read a line w/ get line containing bad characters like \0
2:Is there another tested solution already out there that anyone can recommend ?
3
Code:
#define chunksize 1000000
struct chunk
{
char data[chunksize];
long nextchar;
long size;
};
are there any tips or gotchas i should be aware of?
WR