Hello ,
i am trying to write a script that list the file folders in a directory
i get this message
Warning: stat failed for folder2 (errno=2 - No such file or directory)
but it will output the listing and it will output the stats for it
what is the problem here
Kendall
fileatime() error message
Moderator: General Moderators
Using opendir and readdir
Would this help at all?
Code: Select all
<?php
$this = "";
$handle = opendir('.');
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
if (!strrpos($file, ".")) {
$this .= " ".$file."|";
}
}
}
closedir($handle);
$that = explode("|", $this);
rsort ($that);
reset ($that);
for ($num=0; $thatї$num]; $num++) {
$temp = trim(strstr($thatї$num], ' '));
$pathed = "/".$temp."/";
echo "<a href="$pathed">$temp</a><br>";
}
?>