Where is the difference between “binaries” and “executables” in the context of an executable program?

An executable file is one which can be executed; you would run it on the commandline by writing the name of the file itself as the command. On Unix systems, the file’s “executable” flag must also be set. On Windows, the file’s extension must be one of a fixed set of executable file extensions, including .exe.

A binary file is simply one in a binary (i.e. non-text) format. The binary format means that the file’s contents should not be transformed for platform-specific reasons (e.g. replacing newlines from \n to \r\n).

Binary files are not necessarily executable, for example a library compiled to .dll or .so form is a binary but not an executable. A Java program compiled to .class or .jar form is not an executable file, but might be run using the command java -jar program.jar rather than the command ./program.jar.

Executable files are not necessarily binary, for example a Python script in text form can be made executable on Unix systems by writing a shebang line #!/usr/bin/python3 and setting the file’s executable flag.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)