From 980a9dc64b90b841f67509e14864bbfbf5c550e6 Mon Sep 17 00:00:00 2001 From: Alessandro Comodi Date: Fri, 8 Feb 2019 11:55:10 +0100 Subject: [PATCH] segmatch: added warning for missing files Signed-off-by: Alessandro Comodi --- tools/segmatch.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/segmatch.cc b/tools/segmatch.cc index 748d1a17..917d44ac 100644 --- a/tools/segmatch.cc +++ b/tools/segmatch.cc @@ -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]); }