From 01d2852d64859d9ee97cbacfd2c912635f6c97e1 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 19 Sep 2009 02:04:53 +0200 Subject: tibtoa: Yield a useful error message when the input cannot be read --- bin/tibtoa | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/tibtoa b/bin/tibtoa index 9c18d7a..61c786f 100755 --- a/bin/tibtoa +++ b/bin/tibtoa @@ -26,6 +26,7 @@ my ($header, $footer); my ($char, $char2); my $out; my $cache; +my $file; my ($indent, $rindent) = (0,0); my %opts; my ($program, $length, $offset); @@ -839,7 +840,8 @@ sub header_datestr($) { getopts('ih', \%opts); -open(my $input, '<', shift) or die; +$file = shift; +open(my $input, '<', $file) or die("Cannot open $file: $!"); binmode($input); read($input, $header, $headerlength); $program = <$input>; -- cgit v1.2.3