Validate file before renaming.