I want to check the type of file loaded (suppose the file has the wrong extension).
I believe this can be done by checking the magic number of the file signature. Just like it is done in unix . Therefore, I think I need to read the first bytes of the file and compare them with magic number mappings (and I need to have mappings, and I need to support them).
So, I thought, maybe there is a class for this purpose? Or maybe someone did it and can share their ideas for a solution? Thanks
Alvis source
share