Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/04/2008, 13:12
cadsys
 
Fecha de Ingreso: abril-2008
Mensajes: 101
Antigüedad: 16 años, 1 mes
Puntos: 0
Copiar directorio

Hola a todos me gustaria que me hecharais una mano estoy empezando en esto del PHP, haber si alguien me puede decir como copiar un directorio completo a otro destino he encontrado un script, pero me da un fallo en la linea 3 del mkdir
haber si me podeis decir por que me falla, la llamada la hago rec_copy($dirorigen, $dirdestino);--------- GRACIAS A TODOS.
Código PHP:
<?
function rec_copy ($from_path$to_path) {  
mkdir($to_path0755); 
$this_path getcwd();  
if (
is_dir($from_path)) {  
chdir($from_path);  
$handle=opendir('.');  
while ((
$file readdir($handle))!==false) {  
if ((
$file != ".") && ($file != "..")) {  
if (
is_dir($file)) {  

rec_copy ($from_path.$file."/"$to_path.$file."/");  
chdir($from_path);  
}  
if (
is_file($file)){  
copy($from_path.$file$to_path.$file);  
}  
}  
}  
closedir($handle);  
}  


?>