Actualy this code is running well execpt for
$d = dir("d:\2pac");
it should be $d = dir("d:/2pac/");
but my aim was to applicate a function on each file found.
the function is not ready yet but it should be something like
create a mysql table or an array with the
File name
File size
path of the file
...
...
of each file found
so i don t think that the function above can do it cause it just print a result of a dir command if I m not wrong.
If any body have an idea about it plz let me know.
Johan Näsholm wrote:
Indeed the code works under Linux. Since you use Windows we'll try another approach. I have this snippet that will read the contents of a directory and print it. With some modifications you sould be on your way.
$d = dir("d:\2pac");
while ($entry = $d->read()) {
$pathEntry = $d->path."/".$entry;
if (is_file($pathEntry))
echo $entry."\n";
else if (is_dir($pathEntry))
echo "<b>".$entry."</b>\n";
else
echo "<i>".$pathEntry."</i>\n";
}
Johan