diff options
author | Thomas White <taw@physics.org> | 2019-03-05 10:28:03 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2019-03-05 10:28:03 +0100 |
commit | 177696b03de266772509a9818f74f1e1accd89fb (patch) | |
tree | 60679f9cbecd87fedfe16d22ee6e3deebdd8dce6 /scripts | |
parent | f9104d74ec7c6183521a8eb6500e95470b536b6c (diff) |
check-{near-bragg,peak-detection}: Give better errors
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/check-near-bragg | 5 | ||||
-rwxr-xr-x | scripts/check-peak-detection | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/scripts/check-near-bragg b/scripts/check-near-bragg index 632e1285..2130378b 100755 --- a/scripts/check-near-bragg +++ b/scripts/check-near-bragg @@ -78,6 +78,11 @@ while ( $line = <FH> ) { if ( $n_seen > $skip ) { my $statbuf = stat($filename); + if ( not $statbuf ) { + printf("Couldn't stat image file '%s' - does it exist?\n", + $filename); + exit; + } my $image_mtime = $statbuf->mtime; if ( $image_mtime > $stream_mtime ) { printf(STDERR "WARNING: Image file is newer than stream\n"); diff --git a/scripts/check-peak-detection b/scripts/check-peak-detection index 7d63ccb5..91d21f63 100755 --- a/scripts/check-peak-detection +++ b/scripts/check-peak-detection @@ -125,6 +125,11 @@ while ( $line = <FH> ) { if ( $n_seen > $skip ) { my $statbuf = stat($filename); + if ( not $statbuf ) { + printf("Couldn't stat image file '%s' - does it exist?\n", + $filename); + exit; + } my $image_mtime = $statbuf->mtime; if ( $image_mtime > $stream_mtime ) { printf(STDERR "WARNING: Image file is newer than stream\n"); |