how safe is it to retrieve the size of a file by doing this:
also, how fast is it?Code:fstream fs; .. fs.open("some_file", std::ios::int | std::ios::binary); ... fs.seekg(0, std::ios_base::end); unsigned size = fs.tellg();
also, what would be the best way platform-independent way to get the size of a file?
(i want the size of a file because i want to store the content of it in memory - and want to allocate the buffer only one)