summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2010-10-24 01:51:21 +0000
committerThierry Vignaud <tv@mandriva.org>2010-10-24 01:51:21 +0000
commit46efc8335881b630ae63dc4483500ddce026b434 (patch)
tree32511e61a26b43b3b8f7a2cbf1bea49eea545e01
parent54e72c13bfedc27a9d53102d7d7949646ae94927 (diff)
downloadperl-MDK-Common-46efc8335881b630ae63dc4483500ddce026b434.tar
perl-MDK-Common-46efc8335881b630ae63dc4483500ddce026b434.tar.gz
perl-MDK-Common-46efc8335881b630ae63dc4483500ddce026b434.tar.bz2
perl-MDK-Common-46efc8335881b630ae63dc4483500ddce026b434.tar.xz
perl-MDK-Common-46efc8335881b630ae63dc4483500ddce026b434.zip
append_to_file: better error message making easier to pinpoint actual place of error
-rw-r--r--NEWS3
-rw-r--r--lib/MDK/Common/File.pm2
2 files changed, 4 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index c1aeb6b..e8088a8 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+- append_to_file: better error message making easier to pinpoint actual place
+ of error
+
Version 1.2.26 - 20 July 2010, by Thierry Vignaud
- if_, if__: make easier to debug (#60153)
diff --git a/lib/MDK/Common/File.pm b/lib/MDK/Common/File.pm
index 1d5dc21..48fd702 100644
--- a/lib/MDK/Common/File.pm
+++ b/lib/MDK/Common/File.pm
@@ -151,7 +151,7 @@ sub cat_utf8_or_die { open(my $F, '<:utf8', $_[0]) or die "can't read file $_[0]
sub cat__ { my ($f) = @_; my @l = <$f>; wantarray() ? @l : join '', @l }
sub output { my $f = shift; open(my $F, ">$f") or die "output in file $f failed: $!\n"; print $F $_ foreach @_; fsync($F); 1 }
sub output_utf8 { my $f = shift; open(my $F, '>:utf8', $f) or die "output in file $f failed: $!\n"; print $F $_ foreach @_; fsync($F); 1 }
-sub append_to_file { my $f = shift; open(my $F, ">>$f") or die "output in file $f failed: $!\n"; print $F $_ foreach @_; fsync($F); 1 }
+sub append_to_file { my $f = shift; open(my $F, ">>$f") or die "append to file $f failed: $!\n"; print $F $_ foreach @_; fsync($F); 1 }
sub output_p { my $f = shift; mkdir_p(dirname($f)); output($f, @_) }
sub output_with_perm { my ($f, $perm, @l) = @_; mkdir_p(dirname($f)); output($f, @l); chmod $perm, $f }
sub linkf { unlink $_[1]; link $_[0], $_[1] }