Suppose I have a std::filesystem::path
, which I then open as an std::ifstream
, and suppose that I want to determine its size (e.g. maybe I want to read the whole file).
Should I prefer calling
auto file_size = std::filesyste::file_size(my_path);
or rather, after opening it, calling
my_fstream.seekg(0, std::ios::beg);
auto file_size my_stream.tellg();
?