Give a better error message if writeFile fails due to permission issues
This commit is contained in:
parent
e775d4d84f
commit
9c29a2ed35
|
@ -23,7 +23,7 @@ sub uniq {
|
|||
|
||||
sub writeFile {
|
||||
my ($fn, $s) = @_;
|
||||
open TMP, ">$fn" or die;
|
||||
open TMP, ">$fn" or die "cannot create file `$fn': $!";
|
||||
print TMP "$s" or die;
|
||||
close TMP or die;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ sub writeFile {
|
|||
sub readFile {
|
||||
local $/ = undef;
|
||||
my ($fn) = @_;
|
||||
open TMP, "<$fn" or die;
|
||||
open TMP, "<$fn" or die "cannot open file `$fn': $!";
|
||||
my $s = <TMP>;
|
||||
close TMP or die;
|
||||
return $s;
|
||||
|
|
Loading…
Reference in a new issue