Executable file

from Wikipedia, the free encyclopedia

An executable file (also known as a program file ) is a file that can be executed as a computer program . This can be a binary file in machine language or a bytecode file ( binary program ) that can be executed directly or by a runtime system, or a text file that is interpreted by an operating system shell .

Interaction with operating systems

Some operating systems recognize executable files by their filename extensions (for example .exe ) or by identifiers that are noted next to the file in their metadata (as in Unix-like systems). Most operating systems, however, also check the file format in order not to allow random bit sequences to be executed.

Modern operating systems maintain control over system resources, which means that individual programs have to make system calls to access special resources. Because each family of operating systems has its own system call architectures, executables are generally tied to a specific operating system. However, there are some tools that intercept and convert the system calls, making executable files work on foreign operating systems. Examples are Cygwin and Wine .

Windows

In Microsoft Windows , file types are identified by their file extension. The following can be implemented:

  • com
  • exe
  • bat
  • cmd
  • msc
  • hta(see also: HTML application )
  • pif(actually intended for links , but is also used by computer viruses)
  • scf (is used by special functions, for example "Show desktop" in the quick start bar)
  • scr (Screen saver, same internal format as exe)

A semicolon-separated list of executable file types is defined in the PATHEXT environment variable. None of the file extensions listed in this list need to be entered in the command line. However, a prerequisite for this is either an executable binary format ( *.exe, *.com, *.scr), or a mapping to the appropriate Interpreter (for example cmd.exefor *.batand *.cmdor wscript.exefor *.vbs).

Unix and its derivatives

Under Unix derivatives such as Linux , the "X bit" must be set in the file permissions in order to mark a file as executable. The X bit is usually already set by default so that the file can be executed by everyone.

While binary programs are recognized by their ELF header, scripts and programs written for interpreter languages must begin with a shebang in order to be recognized by the kernel as a program and automatically executed with the correct interpreter.

Under Unix, executable files usually have no file extension , as this is irrelevant when the X bit is set.

macOS

Under Apple's macOS (formerly known as Mac OS X ), user programs ("applications") are subdirectories that have the filename extension ".app" and are called "bundle". This contains all files necessary for the program, i.e. resources, libraries and finally the executable program, which, like other Unix derivatives, has the X bit ("executable") set instead of a file name extension.

z / OS

Under z / OS , the executable program must be available in a program library (organized as a partitioned dataset or PDSE with record format U). A "member" in this library is called a " load module " and can only be executed if the attributes generated by the binder (or linkage editor) are also available in the directory.

An executable program is searched for in the STEPLIB or the JOBLIB, and if it is not found there, the link list is searched. It can be a main program (loaded via the job control ) or a dynamically linked sub-program (loaded by a load command in the program code ).

See also