summaryrefslogtreecommitdiffstats
path: root/lib/MDK/Common/File.pm
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 /lib/MDK/Common/File.pm
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
Diffstat (limited to 'lib/MDK/Common/File.pm')
-rw-r--r--lib/MDK/Common/File.pm2
1 files changed, 1 insertions, 1 deletions
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] }