Hi
Here is my script
function copyDirectory($from, $to) {
$GLOBALS['recursiveCopyFrom'] = $from;
$GLOBALS['recursiveCopyTo'] = $to;
_recursiveCopy('');
}
/**
* This shouldn't be called directly, it is used by the copyDirectory function.
* Parameters are only relative paths.
*/
function _recursiveCopy($relPath) {
$from = $GLOBALS['recursiveCopyFrom'] . '/' . $relPath;
$to = $GLOBALS['recursiveCopyTo'] . '/' . $relPath;
$mode = 0755;
mkdir($to, $mode);
$dir = opendir($from);
while (($item = readdir($dir)) !== false) {
$path = $from . '/' . $item;
if (is_dir($path)) {
if ($item[0] == '.') continue; // don't copy '.' or '..'
_recursiveCopy($relPath . '/' . $item);
} else {
copy($from, $to . '/' . $item);
}
}
closedir($dir);
}
copyDirectory($from,$to);
The problem I have it that the permissions are set to nobody:nobody. I do not own the system, is it possible to change nobody:nobody to jamesm:jamesm in that script?
Thanks in advance 😃