will not try to process empty files (fixes infinite loop if a file is empty)