mirror of
https://git.proxmox.com/git/pve-common
synced 2025-08-13 21:19:12 +00:00
add function file_copy
to have a save copy.
This commit is contained in:
parent
015b013080
commit
23e0e0d786
@ -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) = @_;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user