add function file_copy

to have a save copy.
This commit is contained in:
Wolfgang Link 2015-11-25 10:18:17 +01:00 committed by Dietmar Maurer
parent 015b013080
commit 23e0e0d786

View File

@ -41,6 +41,7 @@ template_replace
safe_print
trim
extract_param
file_copy
);
my $pvelogdir = "/var/log/pve";
@ -220,6 +221,12 @@ sub file_get_contents {
return $content;
}
sub file_copy {
my ($filename, $dst, $max, $perm) = @_;
file_set_contents ($dst, file_get_contents($filename, $max), $perm);
}
sub file_read_firstline {
my ($filename) = @_;