Tools: Deal with input being a directory

This commit is contained in:
shahramn 2024-06-15 13:21:06 +01:00
parent 1f2e30f603
commit 99cfebb1aa
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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;
}