what is a binary file and what's the use of it?
what is a windows binary file?
does linux have a binary file?
how can i create a binary file?
Binary
Re:Binary
A "binary" is usally a generic name for an executable. Binary = computer/machine language.
A "windows binary" is a Portable Executable (PE) format program that runs on Windows
A "linux binary" is an Executable and Linking Format (ELF) format program that runs on linux (Linux also supports COFF and a.out)
You create a binary by compiling and linking code using a compiler or assembler (Like GCC and LD)
A "windows binary" is a Portable Executable (PE) format program that runs on Windows
A "linux binary" is an Executable and Linking Format (ELF) format program that runs on linux (Linux also supports COFF and a.out)
You create a binary by compiling and linking code using a compiler or assembler (Like GCC and LD)
Re:Binary
While "binary" usually indeed refers to a program (and what AR said is correct in that sense), a "binary file" also often means basicly anything that isn't text.
If you are programming in (say) C, you might have noticed that you can open files in both "text" and "binary" mode. In Unix the difference is nil, since text and binary files work the same, but in Windows, opening a file as a text-file can affect the end-of-line conversion.
Depending on the meaning you are after, you can either create a binary file by compiling a program (in case of program binaries) or by simply writing some binary data into a file (binary datafiles).
If you are programming in (say) C, you might have noticed that you can open files in both "text" and "binary" mode. In Unix the difference is nil, since text and binary files work the same, but in Windows, opening a file as a text-file can affect the end-of-line conversion.
Depending on the meaning you are after, you can either create a binary file by compiling a program (in case of program binaries) or by simply writing some binary data into a file (binary datafiles).
Re:Binary
A JPEG image for example is an image stored in a binary format as opossed to an HTML document which is would be considered (in the Windows world, mind you) as a text file.mystran wrote: While "binary" usually indeed refers to a program (and what AR said is correct in that sense), a "binary file" also often means basicly anything that isn't text.
Re:Binary
In the binary vs. text sense, all files are binary...text just means you look for certain characters (or strings) that indicate the end of the line.
From a practical standpoint, Windows ends a line of text with a carriage-return and line-feed pair. In binary mode, when you're reading the file you would see both the \r and the \n characters. In text mode, the \r\n pair is collapsed into a \n when you're reading it in (\n is similarly expanded to \r\n when writing it out). In a system like Unix where lines are terminated by a line-feed character only, there's no practical difference between the two.
From a practical standpoint, Windows ends a line of text with a carriage-return and line-feed pair. In binary mode, when you're reading the file you would see both the \r and the \n characters. In text mode, the \r\n pair is collapsed into a \n when you're reading it in (\n is similarly expanded to \r\n when writing it out). In a system like Unix where lines are terminated by a line-feed character only, there's no practical difference between the two.
Re:Binary
Gargl...
Do you open JPEGs in a text editor? Executables? Sound files? No.
But XML, HTML, text, config-files - those you open in a text editor. (At least occassionally.)
Do you open JPEGs in a text editor? Executables? Sound files? No.
But XML, HTML, text, config-files - those you open in a text editor. (At least occassionally.)
Every good solution is obvious once you've found it.
-
- Member
- Posts: 1600
- Joined: Wed Oct 18, 2006 11:59 am
- Location: Vienna/Austria
- Contact:
Re:Binary
Do *YOU* open text files in a mp3 player?
just take care of the *point de vue* and there is no problem with discussing it. I for one second joel. After all, a text file too keeps binary information. It just depends on who reads/interpretes the content. so *shrugs* 'n' peace.
just take care of the *point de vue* and there is no problem with discussing it. I for one second joel. After all, a text file too keeps binary information. It just depends on who reads/interpretes the content. so *shrugs* 'n' peace.
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
BlueillusionOS iso image
Re:Binary
Everything on a computer is binary. Does that make XML, HTML, C source, Perl scripts and .txt files any less of a group that is called "text files" or "plain text files", to distinguish them from what is commonly called "binary" files (JPEG, WAV, MP3, MOV, EXE, ...)?
Come on, dudes. That kind of pointification isn't helping samjkd.
Come on, dudes. That kind of pointification isn't helping samjkd.
Every good solution is obvious once you've found it.
-
- Member
- Posts: 1600
- Joined: Wed Oct 18, 2006 11:59 am
- Location: Vienna/Austria
- Contact:
Re:Binary
for me, a binary is any file image. That's as it is.
The executing instance which takes the file and looks into its contents makes it be
a text file
a jpeg file
a mov file
... you get the hint.
I do not permit that global catch all definitions prevent /dev/brain from having its little grey wheels spin a bit to get the knack.
the most obvoius occurence of the meaning "binary" is when you download *hqx files with a browser in Linux (don't remember which one): it asks: "what shall i do with the file? a: filter it throu some conversion (decompressing etc) b: download it encoded c: download it as binary."
The knack is: shall the browser do some interpretation/conversion stuff to the downloaded image or shall it save the downloaded image to disk *as it is*
That's my explanation of "binary" vs "text". Now, Solar, it is your turn: better explanation? Other viewpoint?. Thanks btw for reminding me of the crucial manners of responding to the original question instead of bickering in the back.
The executing instance which takes the file and looks into its contents makes it be
a text file
a jpeg file
a mov file
... you get the hint.
I do not permit that global catch all definitions prevent /dev/brain from having its little grey wheels spin a bit to get the knack.
the most obvoius occurence of the meaning "binary" is when you download *hqx files with a browser in Linux (don't remember which one): it asks: "what shall i do with the file? a: filter it throu some conversion (decompressing etc) b: download it encoded c: download it as binary."
The knack is: shall the browser do some interpretation/conversion stuff to the downloaded image or shall it save the downloaded image to disk *as it is*
That's my explanation of "binary" vs "text". Now, Solar, it is your turn: better explanation? Other viewpoint?. Thanks btw for reminding me of the crucial manners of responding to the original question instead of bickering in the back.
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
BlueillusionOS iso image