| General > General Technical Chat |
| Why do people call an executable file (.exe) a binary file? |
| << < (11/14) > >> |
| IanB:
I think T3sl4co1l had the best answer, which is that a binary file is one where the exact order and value of the bytes is critical and must not be changed. If you copy a binary file, the copy must have exactly the same bytes in exactly the same order with no additions, removals, or replacements, or the file will be corrupted. With a text file this is not necessarily the case, for example a line end marker of LF on one system may be replaced by CR+LF on another system without changing the meaning of the file. This was important in the old days with file transfer programs like Kermit, where copying a binary file in text mode might damage the file. It is less important these days in the era of networking, where all files tend to be copied byte for byte and the application tools are more tolerant of different line ending conventions. We then have what magic said, which is that "a binary" tends to be a colloquialism for a binary file containing executable code in one form or another, e.g. *.obj, *.lib, lib*.a, *.dll, *.exe, etc. A .jpg may be a binary file, but it is not commonly referred to as "a binary". In an earlier post I nearly said that opening a binary file in a text editor may produce a display that looks like line noise, but then I thought that many readers may not have even seen line noise and may not know where the term comes from. Lucky are those that never had to connect over a dial up line with an acoustic modem :phew: |
| rsjsouza:
--- Quote from: IanB on April 26, 2020, 09:26:47 pm ---I think T3sl4co1l had the best answer, which is that a binary file is one where the exact order and value of the bytes is critical and must not be changed. If you copy a binary file, the copy must have exactly the same bytes in exactly the same order with no additions, removals, or replacements, or the file will be corrupted. With a text file this is not necessarily the case, for example a line end marker of LF on one system may be replaced by CR+LF on another system without changing the meaning of the file. --- End quote --- If only the world was so simple... :) A XML file is not a binary file, but it can't also have the order of text changed or removed. A batch or shell script falls into the same category and, to top it off, is an executable. These have more lax restrictions than a binary, but not as much as a composed text. The definition has to be related to the human readability. |
| amyk:
--- Quote from: jpanhalt on April 25, 2020, 11:42:51 am ---Here's something to ponder... Here are a few lines from a .hex file: [plain] :100000002F0000EA24F0A0E340F0A0E32CF0A0E3EE :1000100034F0A0E30000A0E1F0FF1FE5BA00A0E388 :10002000070000EAA800A0E3050000EAAE00A0E394 :10003000030000EAB400A0E304E04EE2000000EA9E :10004000BF00A0E304E04EE280119FE50120D0E470 :10005000143091E5200013E3FCFFFF0A000052E397 :1000600000208115F8FFFF1A0850A0E39840A0E394 :100070002E0EA0E1002094E7143091E5200013E358 [/plain] But what you are actually seeing on your monitor is ascii. Does that make it "stupid" to call it a "hex" file? --- End quote --- What I'm actually seeing on my monitor is pixels. Or rather, the photons emitted by said pixels. |
| IanB:
--- Quote from: rsjsouza on April 27, 2020, 01:17:52 am ---A XML file is not a binary file, but it can't also have the order of text changed or removed. --- End quote --- I agree with you. An XML file is not a binary file, it is a text file. |
| T3sl4co1l:
He did say "not necessarily the case"... XML, batch, script -- none should care about the order of whitespace, AFAIK. Whitespace is text, therefore they can be reordered to some extent. Tim |
| Navigation |
| Message Index |
| Next page |
| Previous page |