I'm trying to access the length of the compiled binary of a program, but it returns -1. Could someone point me on the right track? I'm uncertain as to why the following code isn't producing the correct result.
std::fstream file(argv[0], std::ios::binary | std::ios::ate);
std::cout << file.tellg() << "\n";