diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-07-01 10:46:59 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-07-01 10:46:59 +0000 |
commit | 68fbc16b85fc22ad7c95922325748a2bc48fbdac (patch) | |
tree | e8ee8fec859bcd9646d07f5b1c7be4de531f9582 /urpm | |
parent | c5fca0bc726f26aa3a5f1e930f0d00131856c74e (diff) | |
download | urpmi-68fbc16b85fc22ad7c95922325748a2bc48fbdac.tar urpmi-68fbc16b85fc22ad7c95922325748a2bc48fbdac.tar.gz urpmi-68fbc16b85fc22ad7c95922325748a2bc48fbdac.tar.bz2 urpmi-68fbc16b85fc22ad7c95922325748a2bc48fbdac.tar.xz urpmi-68fbc16b85fc22ad7c95922325748a2bc48fbdac.zip |
add append_to_file()
Diffstat (limited to 'urpm')
-rw-r--r-- | urpm/util.pm | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/urpm/util.pm b/urpm/util.pm index 0af9cc53..0a7bbd00 100644 --- a/urpm/util.pm +++ b/urpm/util.pm @@ -14,7 +14,7 @@ our @EXPORT = qw(min max quotespace unquotespace partition put_in_hash uniq uniq_ begins_with difference2 intersection member - file_size cat_ cat_utf8 output_safe dirname basename + file_size cat_ cat_utf8 output_safe append_to_file dirname basename ); (our $VERSION) = q($Revision$) =~ /(\d+)/; @@ -161,6 +161,13 @@ sub output_safe { 1; } +sub append_to_file { + my $f = shift; + open(my $F, '>>', $f) or die "writing to file $f failed: $!\n"; + print $F $_ foreach @_; + 1; +} + 1; __END__ |