Binary File text files and binary data

Source: Internet
Author: User

Binary File text files and binary data

We know that the computer uses binary for computation, so everything stored in the computer is binary.

I also know this sentence, but why do I always hear people say "binary" files and "text" files? According to the above sentence, everything in the computer should be binary!

The underlying storage is binary "data" instead of binary files.

List a binary file as follows: 00000000 h: 0F 01 00 00 0F 03 00 00 12 53 21 45 58 62 35 34; ...... S! Exb542130010h: 41 42 43 44 45 46 48 49 47 4B 4C 4D 4E 4F 50; ABCDEFGHIGKLMNOP
I was totally confused when I saw this binary file. Shouldn't the binary file look like the one listed below?

The binary data stored at the underlying layer should be as follows:

00000000 00000001 10001010 11011101

The hard disk should all be stored in the category of "data. The file we usually talk about is at the operating system level.

Next we will explain the differences between a binary file and a text file:

When a file is considered to be composed of one byte, the maximum bit of each byte in the text file is 0, that is, the text file uses seven bits in one byte to represent all information, the binary file uses all bits in the bytes. This is the difference between the two. When an object is opened in text or binary mode, what is the difference between the two? In fact, both binary files and text files are a series of 0 and 1, but the opening method is different, and the processing of these 0 and 1 is also different. If you open the file in text mode, the file will be translated when it is opened, and each byte will be converted to an ASCII code. If you open the file in binary mode, the file will not be translated; the last step is to edit the text file and binary file in different ways. For example, when you edit text in notepad, the minimum unit for editing is byte. If you edit a binary file, the minimum unit is bit. Of course, we will not directly edit the binary file manually.

Through the above description, we should know what the binary file means!

The above content is a summary of my personal understanding. If there is anything wrong, please point it out.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.