j'ai une fonction qui scanne une arborescence et dans celle-ci je verifie la date du fichier pour le copier ailleur.
j'ai deux messages
Warning: filemtime() [function.filemtime]: stat failed for _s8p6w__.__1 in C:\wamp\www\Shelf\recupshelf.php on line 30
Warning: copy(shelf129/_s8p6w__.__1) [function.copy]: failed to open stream: No such file or directory in C:\wamp\www\Shelf\recupshelf.php on line 35
et lorsque je fais un echo de $datefic il me trouve une abération.(01011970)
function parcours_arbo2($rep,$racine) {
if( $dir = opendir($rep) ) {
$ssrep = array();
while( FALSE !== ($fich = readdir($dir)) ) {
if ($fich != "." && $fich != "..") {
$chemin = "$rep$fich";
if (is_dir($chemin)) {
$ssrep[]= $chemin;
}
else {
$fichier= preg_replace("#^$racine#","", $chemin);
$datefic = date ("dmY", filemtime($fich));
echo $datefic;
$date=date("dmY");
if($datefic<=$date)
{
copy ($fichier,'C:/wamp/www/Shelf/tmp/'.$fich);
}
}
}
}
}
closedir($dir);
foreach ($ssrep as $el) {
parcours_arbo2($el.'/',$racine);
}
}
$rep= "./shelfdossier/";
$arbo = parcours_arbo2($rep,$rep);
merci d'avance si info