mirror of https://github.com/ecmwf/eccodes.git
Tools: Deal with input being a directory
This commit is contained in:
parent
1f2e30f603
commit
99cfebb1aa
|
@ -112,7 +112,7 @@ set -e
|
||||||
[ $status -eq 1 ]
|
[ $status -eq 1 ]
|
||||||
|
|
||||||
${tools_dir}/grib_check_gaussian_grid -v $data_dir > $tempText
|
${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
|
${tools_dir}/grib_check_gaussian_grid -v $ECCODES_SAMPLES_PATH/GRIB2.tmpl > $tempText
|
||||||
grep -q "ignoring" $tempText
|
grep -q "ignoring" $tempText
|
||||||
|
|
|
@ -69,9 +69,9 @@ static int process_file(const char* filename)
|
||||||
grib_handle* h = NULL;
|
grib_handle* h = NULL;
|
||||||
FILE* in = NULL;
|
FILE* in = NULL;
|
||||||
|
|
||||||
if (!path_is_regular_file(filename)) {
|
if (path_is_directory(filename)) {
|
||||||
if (verbose)
|
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;
|
return GRIB_IO_PROBLEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue