summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-09-19 02:04:53 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2009-09-19 02:04:53 +0200
commit01d2852d64859d9ee97cbacfd2c912635f6c97e1 (patch)
tree61b854b704dc7d5c7efe361b62cb80ced6cafb80 /bin
parentaf64d73b674c913080c9674a11640099a7501210 (diff)
tibtoa: Yield a useful error message when the input cannot be read
Diffstat (limited to 'bin')
-rwxr-xr-xbin/tibtoa4
1 files changed, 3 insertions, 1 deletions
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>;