Skip to content

Commit ac3e9d2

Browse files
committed
debugging recursive file dir copying
1 parent 0db28d5 commit ac3e9d2

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

generate/lib/functions.inc.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -345,18 +345,19 @@ function copydirr($fromDir,$toDir,$recursive=true,$chmod=0777,$verbose=false)
345345
}
346346

347347

348-
if (is_dir($from) && $recursive)
349-
{
350-
if (!is_dir($to)) {
351-
mkdir($to, $chmod);
352-
$messages[]='Directory created: '.$to;
353-
//copydirr($from,$to,$recursive,$chmod,$verbose);
354-
}
355-
else
356-
$errors[]='Directory already exists '.$to;
357-
copydirr($from,$to,$recursive,$chmod,$verbose);
358-
}
348+
if (is_dir($from) && $recursive)
349+
{
350+
if (@mkdir($to))
351+
{
352+
chmod($to,$chmod);
353+
$messages[]='Directory created: '.$to;
354+
}
355+
else
356+
$errors[]='cannot create directory '.$to;
357+
copydirr($from,$to,$recursive,$chmod,$verbose);
358+
}
359359
}
360+
}
360361
closedir($handle);
361362
//*/
362363
//* Output

0 commit comments

Comments
 (0)