From 177696b03de266772509a9818f74f1e1accd89fb Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 5 Mar 2019 10:28:03 +0100 Subject: check-{near-bragg,peak-detection}: Give better errors --- scripts/check-near-bragg | 5 +++++ scripts/check-peak-detection | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'scripts') 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 = ) { 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 = ) { 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"); -- cgit v1.2.3