Binary file

A binary file ( engl. binary file ) is a computer file that is not a text file, so that not only includes representations, printable ' characters, but can contain any bit pattern. Binaries depending on the format also contain pieces of data that can be interpreted as texts / characters.

Files in binary format may be used by most computer software in order to align the data on the structural requirements of the processing, or to store particular data fields optimized. In particular, directly executable programs are stored as binary, and often called binary code '.

Background

Basically binaries as such it can be seen that the file contents are displayed with a standard text editor, not or mainly contains no readable characters. Trying to interpret a binary file as a text file ( for example, opening with a text editor ), then yields illegible or nonsensical text. For most of the 8- bit character sets in use today applies: not readable Control characters include characters with ASCII values ​​from 0 to 31, readable characters with values ​​from 32 to 126 readability of characters with values ​​from 127 depends on the character set used. Text files can also include certain control characters, without being therefore regarded as binary; This information can include control characters for line feed, carriage return, page break ( form feed), and tab.

Because binaries use all possible bit combinations, they provide a higher information density than text files. Therefore, they usually require less space on mass storage and can load and save faster. Furthermore, it can be different types of objects ( for example, text with pictures) relatively easy to store. Binary formats are in the exchange across different platforms (such as Windows, Macintosh, Linux ) is not damaged, since the respective software components do not try to convert the files for the target platform. On the other hand, the cross-system data exchange is difficult, since binary files often contain data in a system-dependent format. ( For example, numbers in big- or little-endian format. ) The specification of the file format of a binary file specifies how to proceed with the file. To read, edit and save binary data formats are needed generally special, tailored to the file format editors ( for example, word processing for Office text, an image editor for photos, regedit for the Windows registration database ).

Note that you do not understand data by a binary or binary format under which consist only of the (visible) character "0" and "1" - as the name analogy to Hex ( adezimal ) might suggest file. Also, a file that was created by a word processing program, usually (depending on file size) not a pure text file within the meaning of this term, but a binary file in the include format information and other control characters are not encoded with a readable font. A file in Rich Text Format, for example, is so far a mix of text and binary.

Examples

Computer programs are a typical example for binary files because they contain CPU instructions and data that can take on any byte value. For this reason it is called the executable files of compiled programs often simple binaries '. In contrast, the source code is often stored as a text file.

Other examples of binary files are graphic files, audio files, compressed files (archive files), data for programs for spreadsheet data large amounts of office packages with database systems and data managed esp.

Convert binary file to text

Binaries are occasionally encoded in a text-only representation in order to avoid interference during a transfer between different computer systems. We used coding schemes such as Base64 ( or similar, like the barely spread Base85 or basE91 ) and UUE and MIME formats.

View binaries

To see the genuine content of a binary file, additional software is required. For this task, Hex editors are used. If, however, tried to look at a binary file with a text editor or on the console, then the content is displayed distorted ( see picture). This is because certain bytes or whole byte sequence is interpreted as a control character or control sequences. This manifests itself in most cases in a concert from frequent beep (about the Bell - control characters), characters salad or none at all output. The reason for this is that often all possible states of a 256 octet are found in binaries.

Useful tools for viewing the contents of binary files under Unix and Linux are od ( Abbreviation for octal dump - octal dump ), hexdump ( for hexadecimal dump ) or strings.

As the eight bits of the octet are used to represent decimal numbers or hexadecimal numbers, is described in the Dual System.

18118
de