For example, Portable Executable has several, including the famous "MZ" at the beginning, as well as "PE \ 0 \ 0" at the beginning of the PE header. The Rar file format is "Rar!" the title at the beginning, and some others have similar "magic values" in the file.
What purpose do such magical meanings fulfill?
Because users change the file extension or other programs steal the file extension, it allows the application to cancel processing the file in an unknown format, rather than try its best, and then fail at all.
unix . , "" - , . . Microsoft , . , "" , Microsoft "" , , , .
.
" ", " , "!
:
file
-, , ( ) , . , ( , ), , , , ( - ).
, .
, . , , nn-nn-nn. , , , (, 12-31-99, , , , , -dd-yy), 12 , . , , -, "MM-DD-YY". .
Source: https://habr.com/ru/post/1767576/More articles:Passing a value from a button to a WPF ListView - listviewFailed to load type Error creating new Integration Services package using SQL Server Business Intelligence Development Studio - ssisRegEx Question - remove everything between: and ~ - javascriptBest way to create graphic, cross-platform, e-books? - html5WITH#. Determine at run time if the property is an instance of a type or object? - reflectionWhy doesn't the compiler warn about definitions without names? - c ++How to determine if browser window is activated - javascriptCreating an administration area for managing a dynamic website - c #C # DateTime, Trim without conversion to string - c #Conditionally returning objects in Java (without iterators) - javaAll Articles