tellg(), gcount() and seekg() functions might be helpful for estimating file size. See https://stackoverflow.com/questions/2409504/using-c-filestreams-fstream-how-can-you-determine-the-size-of-a-file