function backup_copy_file ($from_file,$to_file) {
if (is_file($from_file)) {
+ //echo "<br>Copying ".$from_file." to ".$to_file; //Debug
$perms=fileperms($from_file);
return copy($from_file,$to_file) && chmod($to_file,$perms);
}
return backup_copy_dir($from_file,$to_file);
}
else{
+ //echo "<br>Error: not file or dir ".$from_file; //Debug
return false;
}
}
global $CFG;
if (!is_dir($to_file)) {
+ //echo "<br>Creating ".$to_file; //Debug
mkdir($to_file,$CFG->directorypermissions);
}
$dir = opendir($from_file);