Ver Mensaje Individual
  #7 (permalink)  
Antiguo 16/11/2010, 07:45
android
 
Fecha de Ingreso: enero-2009
Mensajes: 45
Antigüedad: 15 años, 3 meses
Puntos: 0
Respuesta: Borrar carpetas que no se hayan sido creadas anteriormente a un cierto tie

Cita:
Iniciado por gandres Ver Mensaje
¿no tienes comillas de más en vartime("$dir."/".$object")?
Si, ya está cambiado, pero sigo teniendo problemas con el filemtime() cuando comprueba el tiempo en las carpetas.

Por ejemplo, para ver el tiempo de la carpeta "updates", uso:

Código PHP:
<?php
function vartime($filepath){
$filet=filemtime($filepath);
$actualt=time();

// define filetime
$yearf=date('Y',$filet);
$monthf=date('n',$filet);
$dayf=date('j',$filet);


// define actualtime
$yeara=date('Y',$actualt);
$montha=date('n',$actualt);
$daya=date('j',$actualt);


$t=(strtotime("$montha/$daya/$yeara")-strtotime("$monthf/$dayf/$yearf"))/60/60/24;
$final=floor($t);
echo 
$final;
}

vartime('updates');


?>
Y obtengo el siguiente error:

Código:
Warning: filemtime() [function.filemtime]: stat failed for updates in C:\xampp\htdocs\prueba\time.php on line 3
14929