True File Type Discovery

Hi, I want to define file types in my application. libmagic is an option. But I'm not going to compare strings like

mp3 file output using libmagic: audio file with ID3 version 2.3.0 contains: MPEG ADTS, level III, v1, 128 kbps, 44.1 kHz, JntStereo

Are there any other libraries for detecting True File Type?

Any help would be appreciated.

+3
source share
2 answers

You can try to implement this using the file signature table.

Example:

Hex Signature        File Extension           ASCII Signature, File Description

49 44 33                        MP3           ID3
                                              MPEG-1 Audio Layer 3 (MP3) audio file

43 44 30 30 31                  ISO           CD001
                                              ISO-9660 CD Disc Image
                                              This signature usually ...
+3
source

, . , . .mp3 () . .AVI,.MKV, MPEG1, MPEG2 MPEG4? .

, CD.ISO - , DVD.ISO? , . "" , , .

+1

All Articles