I'm altering a script I found that itterates through a directory and list the files and the file sizes. I changed the script to seach a seperate directory "data". The directory is stored in my currect directory. The script works fine until I have it search the directory data, it returns the file names, but it doesnt return the filesize. Any hints? Here is what I have already. PHP: $theDirectory = "data"; $listDirectories = false; if(is_dir($theDirectory)) { echo "<table><tr><td>Name</td><td>Type</td><td>Size</td></tr>"; $dir = opendir($theDirectory); while(false !== ($file = readdir($dir))) { $type = filetype($theDirectory ."/". $file); if($listDirectories || $type != "dir") { echo "<tr><td>" . $file . "</td>"; echo "<td>" . $type . "</td>"; echo "<td>"; if($type == "file") echo filesize($file); echo "</td></tr>"; } } closedir($dir); echo "</table>"; } else { echo $theDirectory . " is not a directory"; } When I have the directory set to "." everything works fine, but it's only when I set it to data that I get the trouble. Thanks
http://www.go4expert.com/showthread.php?t=290 checkout this thread, you may find some help in this code.