I'd like to get the size of .so library located in apk file. I was trying to get the size by using tellg()
but it returns -1:
const char* file = "/data/app/com.example.app-wX7zOF4_h5XQiYI8shdLyg==/base.apk!/lib/arm64-v8a/libreader.so";
std::ifstream if(file, std::ios_base::binary | std::ios_base::ate);
return if.tellg();
I'm using C++11, so I can't use std::filesystem::file_size
available in C++17.
Is there another way (probably not so straightforward as file_size
) to get file size using C++11?