Check for file before iteration.