Add an explicit error message for files that can't be opened

This commit is contained in:
Stefan Haustein 2020-07-05 13:15:42 +02:00
parent 134ca73909
commit 37dc1f9b07

View file

@ -1,6 +1,7 @@
#include <iostream> #include <iostream>
#include <bitset> #include <bitset>
#include <cmath> #include <cmath>
#include <fstream>
#include <map> #include <map>
#include <string> #include <string>
#include <vector> #include <vector>
@ -506,7 +507,12 @@ int main(int argc, char* argv[]) {
} }
} }
} else { } else {
std::ifstream fin(arg.c_str());
if (fin) {
file_names.push_back(arg); file_names.push_back(arg);
} else {
std::cerr << "Can't open file (permission?): " << arg << std::endl;
}
} }
} }
} }