473,405 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

binary executable

Why is a binary file executable? Is any binary file executable? Is
only binary file executable? Are all executable files binary? What is
the connection between the attribute of binary and that of executable?
Jun 27 '08 #1
16 4453
Erwin Moller wrote:
Why is a binary file executable?
Why is sky green?
Is any binary file executable?
Well, did you mean to say "every"? Some files are executable.
But not every file executable. Now, what "binary" has to do
with this, I can't tell. Can you? What's "binary"?
Is
only binary file executable?
Uh... What's "binary"?
Are all executable files binary?
Uh... Same question, what's "binary"?
What is
the connection between the attribute of binary and that of executable?
Define "binary". Executable files usually have a special
format that allows the operating system to recognize them
as file containing images of executable programs. "Binary"
is not well defined.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jun 27 '08 #2
Is every binary file executable?

Victor Bazarov wrote:
Erwin Moller wrote:
Why is a binary file executable?

Why is sky green?
Is any binary file executable?

Well, did you mean to say "every"? Some files are executable.
But not every file executable. Now, what "binary" has to do
with this, I can't tell. Can you? What's "binary"?
Is
only binary file executable?

Uh... What's "binary"?
Are all executable files binary?

Uh... Same question, what's "binary"?
What is
the connection between the attribute of binary and that of executable?

Define "binary". Executable files usually have a special
format that allows the operating system to recognize them
as file containing images of executable programs. "Binary"
is not well defined.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jun 27 '08 #3
Erwin Moller wrote:

[please don't top-post]
Is every binary file executable?
Define a binary file.

While you are thinking about that, is a JPEG image executable?

--
Ian Collins.
Jun 27 '08 #4
On May 8, 12:08 pm, Ian Collins <ian-n...@hotmail.comwrote:
Erwin Moller wrote:

[please don't top-post]
Is every binary file executable?

Define a binary file.

While you are thinking about that, is a JPEG image executable?

--
Ian Collins.
Is binary file vague concept?
Jun 27 '08 #5
Erwin Moller wrote:
On May 8, 12:08 pm, Ian Collins <ian-n...@hotmail.comwrote:
>Erwin Moller wrote:

[please don't top-post]
>>Is every binary file executable?
Define a binary file.

While you are thinking about that, is a JPEG image executable?

Is binary file vague concept?
It certainly isn't defined in terms of C++. Some platforms
differentiate between binary and text files, others do not.

--
Ian Collins.
Jun 27 '08 #6
Erwin Moller kirjoitti:
Is binary file vague concept?
No, it's a physical form of a file.
Jun 27 '08 #7
On Thu, 08 May 2008 03:36:22 -0700, Krice wrote:
Erwin Moller kirjoitti:
>Is binary file vague concept?

No, it's a physical form of a file.
What on earth does that mean?

--
Lionel B
Jun 27 '08 #8
Erwin Moller <hi**********@gmail.comwrites:
Why is a binary file executable? Is any binary file executable? Is
only binary file executable? Are all executable files binary?
Some systems distinguish between text and non-text (i.e. binary) files.
Not all do. The ones that do, will perform various text translations
when writing to a text file.
What is
the connection between the attribute of binary and that of executable?
There is none. What makes a file "binary" is not its contents, but whether or
not you included ios::binary in the optional flags argument to fstream::open.

On systems that care, you can open a file that has text in it as binary to
avoid the translations that would happen if you opened it as text. You can
also do the opposite, but that's rarely useful; text-mode translations
generally FUBAR any binary data.

sherm--

--
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
Jun 27 '08 #9
Erwin Moller <hi**********@gmail.comwrote in news:c1b9850c-c22e-4375-
96***************@w1g2000prd.googlegroups.com:
On May 8, 12:08 pm, Ian Collins <ian-n...@hotmail.comwrote:
>Erwin Moller wrote:

[please don't top-post]
Is every binary file executable?

Define a binary file.

While you are thinking about that, is a JPEG image executable?

--
Ian Collins.

Is binary file vague concept?
Well, from the computer's POV all files are binary. Traditionally, any
file that isn't human readable is considered binary and they come in all
shapes and sizes. Some of those files will be executable and some won't.
For example, an SQL database will be binary, but won't be executable. On
the other hand, script languages are executable and are also human
readable. The concepts are orthoganal in that regard.

HTH,
joe
Jun 27 '08 #10
Joe Greer wrote:
[..] For example, an SQL database will be binary, but won't be
executable. On the other hand, script languages are executable and
are also human readable. The concepts are orthoganal in that regard.
If one would be strict in that regard, then only bootstrap program
is truly executable, and everything else is data, _especially_ scripts,
which are but the source data to the corresponding interpreter...

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jun 27 '08 #11
On 8 touko, 14:44, Lionel B <m...@privacy.netwrote:
No, it's a physical form of a file.
What on earth does that mean?
"Binary digits are a basic unit of information storage and
communication
in digital computing and digital information theory"

http://en.wikipedia.org/wiki/Bit
Jun 27 '08 #12
On May 7, 9:20*pm, Erwin Moller <hi.steven...@gmail.comwrote:
Why is a binary file executable? Is any binary file executable? Is
only binary file executable? Are all executable files binary? What is
the connection between the attribute of binary and that of executable?

Calling an executable (or sometime an object) file a "binary" is more
slang than anything formal. You can take it to mean to file contains
something approximating machine code. Whether that has any relation
to anything called a "binary" file on your particular platform, or
even if your platform has anything called a "binary file," is a whole
different issue. For example, executables (and object files) on zOS
are in a structured* file format, which is not really anything to
would map conceptually to a *nix style stream type file (of either
binary or text forms). But those are still semi-commonly called
"binaries."

The term is also used with some frequency for the image files
containing the data (instructions and whatnot) intended to be burned
into a ROM or similar for embedded systems, even though those files,
for historical reasons, often actually contain ASCII hex.

Java byte code and MSIL (.NET) executables are also often called
binaries (which would fall under "approximating machine code").
*IOW, the file actually consists of independent records and other
goodies, rather than a stream of bytes.
Jun 27 '08 #13
Victor Bazarov wrote:
Joe Greer wrote:
>[..] For example, an SQL database will be binary, but won't be
executable. On the other hand, script languages are executable and
are also human readable. The concepts are orthoganal in that regard.

If one would be strict in that regard, then only bootstrap program
is truly executable, and everything else is data, _especially_ scripts,
which are but the source data to the corresponding interpreter...

V
No, the bootstrap program is also data, to be interpreted by the hardware.

The hardware is only data that is interpreted by the universe and
physicists.

LISP is the rest.

--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
Jun 27 '08 #14
Hello Erwin
Why is a binary file executable? Is any binary file executable? Is
only binary file executable? Are all executable files binary? What is
the connection between the attribute of binary and that of executable?
try http://en.wikipedia.org/wiki/Executable, http://en.wikipedia.org/wiki/Binary_file
and http://en.wikipedia.org/wiki/Binary.

Hope that can help you

Regards
Rafael
Jun 27 '08 #15
On May 8, 4:58 pm, Sherman Pendley <spamt...@dot-app.orgwrote:
Erwin Moller <hi.steven...@gmail.comwrites:
Why is a binary file executable? Is any binary file
executable? Is only binary file executable? Are all
executable files binary?
Some systems distinguish between text and non-text (i.e.
binary) files. Not all do. The ones that do, will perform
various text translations when writing to a text file.
If the system distinguishes, then the C++ library will likely do
more than just text translations---you probably won't be able to
open a file unless the mode corresponds to the one it was
written in.

A lot of systems have conventions concerning what goes into a
text file, even if the system itself doesn't have different file
types for binary and text. In such cases, the standard library
will normally ensure a translation between the system's
conventions and those imposed by the C++ standard. (Also:
because they are conventions, and not part of the system, they
are often a little bit vague. Under Windows, for example, some
programs treat the sequence 0x0D,0x0A as a line terminator,
others as a line separator.)

As a general rule, a file is considered "text" if its contents
can be interpreted as printable characters, plus a few control
characters such as new line, in some encoding, and 2) it
conforms more or less to the system conventions with regards to
things like how newline and end of file are represented.
Although even 2 is somewhat uncertain: most Windows programs
I've seen consider text files from Unix to be text, even if they
don't conform to the Windows convention for new line. And a
growing number of Unix programs can handle Windows conventions.

Anything which isn't considered "text" is considered "binary".
What is the connection between the attribute of binary and
that of executable?
There is none. What makes a file "binary" is not its contents,
but whether or not you included ios::binary in the optional
flags argument to fstream::open.
At one level. At the system level, of course, different
criteria apply, see above.

And again, the distinction as to what is executable and what
isn't isn't always clear: under Unix, there's an executable mode
bit, but not all files on which is is set will be executable.
For that matter: if I generate a .exe file with VC++, it's
really an executable, right? Even if I do so on a shared mount,
and am looking at it under Solaris? Are my bash shell scripts
executable even if I mount the file system on a machine on which
bash isn't installed. (Don't have any here, but Posix only
requires the Korn shell---and one could imagine thus that a bash
shell script be executable on some machines running Solaris, but
not on others.)
On systems that care, you can open a file that has text in it
as binary to avoid the translations that would happen if you
opened it as text.
Again, you're playing with language: the distinction text/binary
has a different meaning with regards to the C++ standard library
than it does in general use. And just because you opened a file
in binary doesn't mean that none of the text related
translations will occur; some depend on the mode of open, but
others (e.g. code translation) depend on the imbued locale.
You can also do the opposite, but that's rarely useful;
text-mode translations generally FUBAR any binary data.
Yes. Historically, binary meant transparent. That convention
was broken by the C++ committee, however.

And of course, the open mode doesn't really affect how you
interpret the data in your program. Although it doesn't
generally make sense to do so, you can always interpret the
binary value of a char variable as binary data, rather than as a
character code.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Jun 27 '08 #16
On Thu, 08 May 2008 10:20:17 -0700, Krice wrote:
On 8 touko, 14:44, Lionel B <m...@privacy.netwrote:
No, it's a physical form of a file.
What on earth does that mean?

"Binary digits are a basic unit of information storage and communication
in digital computing and digital information theory"

http://en.wikipedia.org/wiki/Bit
Yeah, I know what a "bit" is, thanks. Now what does "physical form of a
file" mean, and why is it relevant?

--
Lionel B
Jun 27 '08 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: ishmael4 | last post by:
hello everyone! i have a problem with reading from binary file. i was googling and searching, but i just cant understand, why isnt this code working. i could use any help. here's the source code:...
22
by: Sunner Sun | last post by:
Hi, all Since the OS look both ASCII and binary file as a sequence of bytes, is there any way to determine the file type except to judge the extension? Thank you!
24
by: pristo | last post by:
hello All, how can i insert unique ID into binary file (that created by compiler)? (so after compiling i can to identify the src that i use) thx
2
by: Oleg Subachev | last post by:
I need to add binary data to C# executable and then read it back during execution or from another application. In Delphi for Win32 I used the following: - created binary Win32 resource with...
8
by: dagecko | last post by:
Hi I would like to know how to detect if a file is binary or not. It's important for me but I don't know where to start. Ty
3
by: linux_bp | last post by:
I had deleted my object files accidently. Now to analyse a core i need object files. If I recompile the same source code with imake on solaris, i m getting the binary of different size. Is it...
4
by: FreewareGuy | last post by:
I want to add binary files to my VB 2005 executable to make a single exe with all the required files which I can extract at will through my code, how do I do this pls. guide o how to add binary...
3
by: techtonik | last post by:
Hello, everyb. Does anybody know simple cross-platform method of probing if executable binary is available and launching it. Problem no.1: test if executable file is available I'll take...
11
by: itdevries | last post by:
Hi, I'm trying to convert some char data I read from a binary file (using ifstream) to a float type. I've managed to convert the int types but now I need to do the float types as well but it...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.