And here is the problem.
What is the difference between text file and binary file. Understanding the difference between Binary and Text Files. Ive googled it but no one seems to really know. While both binary and text files contain data stored as a series of bits binary values of 1s and 0s the bits in text files represent characters while the bits in binary files represent custom data.
A file is saved on Hard-disk. In addition there are carriage return 0x0d line feed 0x0a TAB 0x09 etc so there is room for compression. Internal conversion is required in text file and hence it is slower but binary file does not need any translation and so is faster.
A binary file can contain bytes that have values between 0 and 255 decimal. Similarly for other types of files such as audio pictures and videos computers will use different decoding methods to interpret the binary sequences they contain. A text file is considered to contain lines of text that are separated by some end-of-line markings.
The two file types may look the same on the surface but their internal structures are different. The file is simple. 32667 occupies 5 bytes even though it occupies 2 bytes in memory.
Any file saved on hard-disk has to follow the semantics of the two states. Whereas in a txt file you cant have any of that. In text file text character numbers are stored one character per byte ie.
In binary mode such translations. In binary file data is stored in binary format and each data would occupy the same number of bytes on disks as it occupies in memory. A flat file can be a plain text file or a binary file.