diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index de8e2d674..7fbff3ce9 100755 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -391,9 +391,11 @@ class G return false; } $dir = opendir($source); - if (! file_exists($destination)) { - @mkdir($destination); + + if (!file_exists($destination)) { + G::mk_dir($destination, 0777); } + while (false !== ( $file = readdir($dir))) { if (( $file != '.' ) && ( $file != '..' )) { if ( is_dir($source . '/' . $file) ) { diff --git a/workflow/engine/classes/class.wsTools.php b/workflow/engine/classes/class.wsTools.php index 6565710e3..5c65a144d 100755 --- a/workflow/engine/classes/class.wsTools.php +++ b/workflow/engine/classes/class.wsTools.php @@ -547,8 +547,9 @@ class workspaceTools //lenght = 2, because the function check . and .. dir links $newDiretory = G::getPathFromUIDPlain($UIdDir); CLI::logging("Migrating $UIdDir to $newDiretory\n"); - G::mk_dir($newDiretory); + G::mk_dir($newDiretory, 0777); //echo `cp -R $UIdDir/* $newDiretory/`; + if (G::recursive_copy($UIdDir, $newDiretory)) { CLI::logging("Removing $UIdDir...\n"); G::rm_dir($UIdDir); @@ -576,8 +577,9 @@ class workspaceTools $goalFile = $levelfile[$lastlevel - 1]; $newpattern = G::getPathFromFileUIDPlain($blackHoleDir, $goalFile); CLI::logging("Migrating $blackHoleDir file: $goalFile\n"); - G::mk_dir($blackHoleDir . '/' . $newpattern[0]); + G::mk_dir($blackHoleDir . PATH_SEP . $newpattern[0], 0777); //echo `cp -R $black$goalFile $black$newpattern[0]/$newpattern[1]`; + if (copy($black . $goalFile, $black . $newpattern[0] . '/' . $newpattern[1])) { unlink($file[$index]); } else {