magic¶

Detection of file type via magic numbers / signatures.

Checks here are based on the file signature, not the file extension. They are all intented to be fast and lightweight, and should not require parsing the entire file. There may occationally be false positives which should be caught when attemping to parse the file.

Functions

is_dcm

Determines whether the given file is a DICOM file.

is_dir

Check if file is a directory.

is_sqlite3

Check if a file is a SQLite database.

is_zip

Check if a file is a ZIP archive.