[snip] Yes $open_dir is the handle from opendir(). The file_exists is simply checking for an associated file elsewhere as I'm looking for video files and thumbnails. As I said, this works fine for avi suffixed files but not mpg or mpeg suffixed files. [/snip] Make sure to always hit reply-all, or the e-mail will not go back to the list. 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? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php