aboutsummaryrefslogtreecommitdiff
path: root/scripts/check-near-bragg
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-06-22 16:12:54 +0200
committerThomas White <taw@physics.org>2018-06-22 16:13:38 +0200
commit615ab167e9d1624410575e4809dd9060d4a90252 (patch)
tree368652aef774640d1881a3755ba4a25db18f3a2a /scripts/check-near-bragg
parent3400d1416d8eb07b21595638c6d6e738bd6b1ccc (diff)
check-near-bragg/check-peak-detection: Give better error message
Diffstat (limited to 'scripts/check-near-bragg')
-rwxr-xr-xscripts/check-near-bragg6
1 files changed, 5 insertions, 1 deletions
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;