Avoid redundant calls to `file`
Complain on error