From 79b231198f5ee960b3ab3b359165afadee348049 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Tue, 1 Nov 2022 19:03:37 +0000 Subject: [PATCH] slurm-process: check input files are readable --- rainfallwrangler/slurm-process.job | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/rainfallwrangler/slurm-process.job b/rainfallwrangler/slurm-process.job index 1825c65..251ef2d 100755 --- a/rainfallwrangler/slurm-process.job +++ b/rainfallwrangler/slurm-process.job @@ -36,8 +36,17 @@ if [[ -z "${OUTPUT}" ]]; then exit 1; fi +if [[ ! -r "${RAINFALL}" ]]; then + echo "Error: That input rainfall file either doesn't exist, isn't a directory, or we don't have permission to access it."; + exit 3; +fi +if [[ ! -r "${WATER}" ]]; then + echo "Error: That input water depth file either doesn't exist, isn't a directory, or we don't have permission to access it."; + exit 3; +fi + if [[ ! -d "${OUTPUT}" ]]; then - echo "Error: That input directory either doesn't exist, isn't a directory, or we don't have permission to access it."; + echo "Error: That output directory either doesn't exist, isn't a directory, or we don't have permission to access it."; exit 3; fi