segmatch: added warning for missing files

Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
This commit is contained in:
Alessandro Comodi 2019-02-08 11:55:10 +01:00
parent 7d97c2c347
commit 980a9dc64b
1 changed files with 6 additions and 0 deletions

View File

@ -235,6 +235,12 @@ int main(int argc, char** argv) {
printf("Reading %s.\n", argv[optind]);
std::ifstream f;
f.open(argv[optind]);
// Check if input file exists.
if (!f.good()) {
printf("WARNING: Input file does not exist!\n");
}
assert(!f.fail());
read_input(f, argv[optind]);
}