Hacker News new | past | comments | ask | show | jobs | submit login

Every major file type (or nearly every, anyway) has a set of signature bytes, a "magic number" or something equivalent that identifies it as being of that type. This lets programs identify what kind of object a file represents without requiring this information to be supplied by the user.

Most file types have this magic signature as the initial few bytes of the file. For example, a Windows executable always begins with the ASCII characters "MZ".

The point is that with non-overlapping magic signatures, a single file can be simultaneously identified as more than one type.




File format trivia:

"MZ" are the initials of Mark Zbikowski, one of the developers of MS-DOS. :)

http://en.wikipedia.org/wiki/DOS_MZ_executable




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: