Check file before using it.