diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-12-20 12:22:13 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-12-20 12:22:13 +0100 |
commit | 9c29a2ed35d884cda182cea74aee2a7ee614de93 (patch) | |
tree | 81b8a74d50f9cc4482132e957fb726adf0206170 /perl/lib/Nix/Utils.pm | |
parent | e775d4d84fe4b90464b00d560ceb79665301d79b (diff) |
Give a better error message if writeFile fails due to permission issues
Diffstat (limited to 'perl/lib/Nix/Utils.pm')
-rw-r--r-- | perl/lib/Nix/Utils.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/perl/lib/Nix/Utils.pm b/perl/lib/Nix/Utils.pm index bc180e2a5..78d3db542 100644 --- a/perl/lib/Nix/Utils.pm +++ b/perl/lib/Nix/Utils.pm @@ -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; |