I am having troubles with my script. It is reading directories as files for some odd reason.
You can read the entire problem here: http://www.wdforums.com/forums/showthread.php?s=&threadid=1733
-Matt
Recently i am doing the same thing exactly of yours and i find that you must chdir() to the target directory where the file inside is being examined by php.