diff --git a/dbLoadTemplate b/dbLoadTemplate index 6e842d3..5d6d005 100755 --- a/dbLoadTemplate +++ b/dbLoadTemplate @@ -107,6 +107,8 @@ sub parseSubst { $@ =~ /end of file/ or die $@; return 0; } + die "template file $filename not found in $ARGV line $.\n" unless -e $filename; + die "template file $filename not readable in $ARGV line $.\n" unless -r $filename; eval { expect "{","pattern|{ 'pattern' or '{'" }; if ($_ eq "{") { # old style substitution @@ -152,6 +154,10 @@ sub parseSubst { } sub parseFiles { + foreach (@_) { + die "file $_ not found.\n" unless -e $_; + die "file $_ not readable.\n" unless -r $_; + } foreach (@_) { local *ARGV; local %subst;