Current location - Quotes Website - Personality signature - Feature signature of file format
Feature signature of file format
One method widely used in UNIX and its derivative operating systems is to store a special number in a specific location of a file. Initially, this number is usually the first 2 bytes of the file. In general, any unique character sequence can be used as a feature signature. For example, a GIF graphic is signed with the six bytes at the beginning of the file as a feature, which can be GIF87a or GIF89a. However, some files are difficult to identify in this way, such as HTML files.

This can better prevent misjudgment of file format, and feature signature can give more detailed file format information. The disadvantage of this method is its low efficiency. Especially when displaying a large number of files, because each signature has a different recognition method, judging the file format will consume a lot of system resources. The extension and metadata schema mentioned later can be matched quickly because they are data in a fixed format. Applications usually use feature signatures to determine whether a file is complete and valid.