You need to get the script to display the name of the file that it failed on (unless you simply didn't show it in your excerpt) and then look at the permissions for the file in question. Also it would be a good idea to catch the exception in your code so that you can report the error and then carry on. Also make sure that you do not process the any files that you have already processed on a previous run by ignoring file names that end in ".eps".