Skip to content

Instantly share code, notes, and snippets.

@aashish-chaubey
Last active February 14, 2020 07:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aashish-chaubey/1a6fa8252ed933aa1861363ed5ee3952 to your computer and use it in GitHub Desktop.
Save aashish-chaubey/1a6fa8252ed933aa1861363ed5ee3952 to your computer and use it in GitHub Desktop.
Checking if the file binary is a RIFF type or any other type
start_text = "RIFF"
import os
for i, filename in enumerate(os.listdir('./')):
with open(filename, 'rb') as imageFile:
if imageFile.read().startswith(b'RIFF'):
print(f"{i+1}: {filename} - found!")
else:
continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment