From 615ab167e9d1624410575e4809dd9060d4a90252 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 22 Jun 2018 16:12:54 +0200 Subject: check-near-bragg/check-peak-detection: Give better error message --- scripts/check-near-bragg | 6 +++++- scripts/check-peak-detection | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/check-near-bragg b/scripts/check-near-bragg index 467ff943..7fd7d013 100755 --- a/scripts/check-near-bragg +++ b/scripts/check-near-bragg @@ -18,7 +18,11 @@ if ( !($args eq "") ) { open(FH, $ARGV[0]); open(TMP, "> list.tmp"); -my $statbuf = stat($ARGV[0]); +my $statbuf = stat($file); +if ( not $statbuf ) { + printf("Couldn't stat stream. Check the filename.\n"); + exit; +} my $stream_mtime = $statbuf->mtime; my $in_image = 0; diff --git a/scripts/check-peak-detection b/scripts/check-peak-detection index 8f2e1378..7d63ccb5 100755 --- a/scripts/check-peak-detection +++ b/scripts/check-peak-detection @@ -36,7 +36,11 @@ if ( !($args eq "") ) { open(FH, $file); open(TMP, "> list.tmp"); -my $statbuf = stat($ARGV[0]); +my $statbuf = stat($file); +if ( not $statbuf ) { + printf("Couldn't stat stream. Check the filename.\n"); + exit; +} my $stream_mtime = $statbuf->mtime; my $in_image = 0; -- cgit v1.2.3