Skip to content

Commit

Permalink
Tools: Deal with input being a directory
Browse files Browse the repository at this point in the history
  • Loading branch information
shahramn committed Jun 15, 2024
1 parent 1f2e30f commit 99cfebb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/grib_check_gaussian_grids.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tools/grib_check_gaussian_grid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 99cfebb

Please sign in to comment.