Check whether a file is binary before trying to process it