From 99cfebb1aaaef858f6443241f3c4ba6b4f54c938 Mon Sep 17 00:00:00 2001 From: shahramn Date: Sat, 15 Jun 2024 13:21:06 +0100 Subject: [PATCH] Tools: Deal with input being a directory --- tests/grib_check_gaussian_grids.sh | 2 +- tools/grib_check_gaussian_grid.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/grib_check_gaussian_grids.sh b/tests/grib_check_gaussian_grids.sh index 21d639291..3abf03942 100755 --- a/tests/grib_check_gaussian_grids.sh +++ b/tests/grib_check_gaussian_grids.sh @@ -112,7 +112,7 @@ set -e [ $status -eq 1 ] ${tools_dir}/grib_check_gaussian_grid -v $data_dir > $tempText -grep -q "not a regular file" $tempText +grep -q "is a directory" $tempText ${tools_dir}/grib_check_gaussian_grid -v $ECCODES_SAMPLES_PATH/GRIB2.tmpl > $tempText grep -q "ignoring" $tempText diff --git a/tools/grib_check_gaussian_grid.cc b/tools/grib_check_gaussian_grid.cc index 9fb0ddc9b..666658490 100644 --- a/tools/grib_check_gaussian_grid.cc +++ b/tools/grib_check_gaussian_grid.cc @@ -69,9 +69,9 @@ static int process_file(const char* filename) grib_handle* h = NULL; FILE* in = NULL; - if (!path_is_regular_file(filename)) { + if (path_is_directory(filename)) { if (verbose) - printf(" WARNING: '%s' not a regular file! Ignoring\n", filename); + printf(" WARNING: '%s' is a directory! Ignoring\n", filename); return GRIB_IO_PROBLEM; }