added error messages for file not found.

Signed-off-by: Mariano Alvira <mar@devl.org>
This commit is contained in:
Mariano Alvira 2009-08-10 16:52:36 -04:00
parent 5830ea153e
commit f4859e129d

View file

@ -18,7 +18,7 @@ GetOptions ('file=s' => \$filename,
'terminal=s' => \$term, 'terminal=s' => \$term,
'verbose' => \$verbose, 'verbose' => \$verbose,
'baud=s' => \$baud, 'baud=s' => \$baud,
); ) or die 'bad options';
$| = 1; $| = 1;
@ -34,11 +34,12 @@ if($filename eq '') {
exit; exit;
} }
if (!(-e $filename)) { die "file $filename not found\n"; }
if (($second ne '') && !(-e $second)) { die "secondary file $second not found\n"; }
my $ob = Device::SerialPort->new ($term) or die "Can't start $term\n"; my $ob = Device::SerialPort->new ($term) or die "Can't start $term\n";
# next test will die at runtime unless $ob # next test will die at runtime unless $ob
if ($filename eq '') { die "you must specify a file with -f\n"; }
$ob->baudrate($baud); $ob->baudrate($baud);
$ob->parity('none'); $ob->parity('none');
$ob->databits(8); $ob->databits(8);