Only read the first 512 bytes to determine the file type