diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2009-09-19 02:04:53 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2009-09-19 02:04:53 +0200 |
commit | 01d2852d64859d9ee97cbacfd2c912635f6c97e1 (patch) | |
tree | 61b854b704dc7d5c7efe361b62cb80ced6cafb80 | |
parent | af64d73b674c913080c9674a11640099a7501210 (diff) |
tibtoa: Yield a useful error message when the input cannot be read
-rwxr-xr-x | bin/tibtoa | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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>; |