[snip] > If file exists is looking for an associated files is it probable that the > .mpg files do not have one associated with it in the other directory? It is probable, that's why the check is there, but in this case the associated file(s) definitely does exist. If I simply change the file extensions from mpg to avi the script works. [/snip] Try this simple example and see what is output... if ($handle = opendir('/path/to/files')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { echo "$file\n"; } } closedir($handle); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php