File association
Encyclopedia
A file association associates a file with an application
Application software
Application software, also known as an application or an "app", is computer software designed to help the user to perform specific tasks. Examples include enterprise software, accounting software, office suites, graphics software and media players. Many application programs deal principally with...

 capable of opening that file. More commonly, a file association associates a class of files (usually determined by their filename extension
Filename extension
A filename extension is a suffix to the name of a computer file applied to indicate the encoding of its contents or usage....

, such as .txt) with a corresponding application (such as a text editor
Text editor
A text editor is a type of program used for editing plain text files.Text editors are often provided with operating systems or software development packages, and can be used to change configuration files and programming language source code....

).

Associations and verbs

A single file extension may have several associations for performing various actions, also known as verbs. Some of the common verbs are:
  • open to open a file
  • edit to open a file for editing
  • print to print a file

A picture, for example, may be associated with these verbs so that open opens the picture in an image viewer, edit opens up an image editing program and print sends the picture to a printer.

Implementations

Most operating systems support file associations in some form or the other. For example, opening a file from a file manager usually invokes the open verb in order to open the file with its associated application. Additional actions such as print are usually accessed via a right-click context menu
Context menu
A context menu is a menu in a graphical user interface that appears upon user interaction, such as a right mouse click or middle click mouse operation...

. A mechanism for modifying associations is also usually present. An example for this is the Open With option in the Windows Shell
Windows Shell
The Windows shell is the main graphical user interface in Microsoft Windows, and since Windows 95 hosted by Windows Explorer. The Windows shell includes well-known Windows components such as the Taskbar and the Start menu...

.

Microsoft Windows

The Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 series of operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

s, beginning with Windows 3.x
Windows 3.x
Windows 3.x can refer to either an individual or all of the following versions of Microsoft Windows:*Windows 3.0*Windows 3.1x*Windows 3.2...

 supports file extension-based associations. Associations are stored in registry
Windows registry
The Windows Registry is a hierarchical database that stores configuration settings and options on Microsoft Windows operating systems. It contains settings for low-level operating system components as well as the applications running on the platform: the kernel, device drivers, services, SAM, user...

 as sets of verbs for each file extension. Older versions supported open associations stored in WIN.INI
WIN.INI
WIN.INI is a basic INI file that was used in versions of the Microsoft Windows operating environment up to Windows 3.11 to store basic settings at boot time. By default, all font, communications drivers, wallpaper, screen saver, and language settings were stored in WIN.INI by Windows 3.x...

.
File associations can be displayed and edited using the assoc command
Command (computing)
In computing, a command is a directive to a computer program acting as an interpreter of some kind, in order to perform a specific task. Most commonly a command is a directive to some kind of command line interface, such as a shell....

 and with the help of the ftype command it is possible to create association between file type and application which will open files of this type.

The Windows shell invokes file association actions through COM
Component Object Model
Component Object Model is a binary-interface standard for software componentry introduced by Microsoft in 1993. It is used to enable interprocess communication and dynamic object creation in a large range of programming languages...

, drag and drop, command line calls or through Dynamic Data Exchange
Dynamic Data Exchange
Dynamic Data Exchange is a technology for interprocess communication under Microsoft Windows or OS/2.- Overview :Dynamic Data Exchange was first introduced in 1987 with the release of Windows 2.0 as a method of interprocess communication so that one program can communicate with or control another...

. Advanced features of Microsoft Windows file associations included manually defining a new file extension with any number of associated actions, a primary default action, showing extensions only for specific file types, customizing the file type icon and description and customizing associated MIME
MIME
Multipurpose Internet Mail Extensions is an Internet standard that extends the format of email to support:* Text in character sets other than ASCII* Non-text attachments* Message bodies with multiple parts...

 type and their handling (how to handle file types for files downloaded or directly opened from within the Internet Explorer
Internet Explorer
Windows Internet Explorer is a series of graphical web browsers developed by Microsoft and included as part of the Microsoft Windows line of operating systems, starting in 1995. It was first released as part of the add-on package Plus! for Windows 95 that year...

 browser). The ability to configure advanced file association functionality, however, was removed in Windows Vista
Windows Vista
Windows Vista is an operating system released in several variations developed by Microsoft for use on personal computers, including home and business desktops, laptops, tablet PCs, and media center PCs...

 and later operating systems.

Linux

Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

-based GUIs, such as KDE
KDE
KDE is an international free software community producing an integrated set of cross-platform applications designed to run on Linux, FreeBSD, Microsoft Windows, Solaris and Mac OS X systems...

 and GNOME
GNOME
GNOME is a desktop environment and graphical user interface that runs on top of a computer operating system. It is composed entirely of free and open source software...

, support MIME type
Internet media type
An Internet media type, originally called a MIME type after MIME and sometimes a Content-type after the name of a header in several protocols whose value is such a type, is a two-part identifier for file formats on the Internet.The identifiers were originally defined in RFC 2046 for use in email...

-based associations. For example, the MIME type text/plain might be associated with a text editor.

Mac OS

Classic Mac OS
Mac OS
Mac OS is a series of graphical user interface-based operating systems developed by Apple Inc. for their Macintosh line of computer systems. The Macintosh user experience is credited with popularizing the graphical user interface...

 used type code
Type code
A type code is the only mechanism used in pre-Mac OS X versions of the Macintosh operating system to denote a file's format, in a manner similar to file extensions in other operating systems. Codes are four-byte OSTypes...

s and creator code
Creator code
A creator code is a mechanism introduced in pre-Mac OS X versions of the Macintosh operating system to link a data file to the application program which created it, in a manner similar to file extensions in other operating systems. Codes are four-byte OSTypes. For example, the creator code of the...

s to associate each file with its corresponding application, regardless of file extension. The more recent Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...

 also supports file extension–based associations.

Application bundles in OS X declare supported file types in their Info.plist file. For each of these specified types, a Uniform Type Identifier
Uniform Type Identifier
A Uniform Type Identifier is a text string used on software provided by Apple Inc. to uniquely identify a given class or type of item...

 is given, along with a list of 'tags' which define how a file or data of this type could be identified. For example, the JPEG
JPEG
In computing, JPEG . The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and image quality. JPEG typically achieves 10:1 compression with little perceptible loss in image quality....

 type is defined with a UTI of 'public.jpeg', and tagged with the extensions 'jpg' and 'jpeg', the MIME
MIME
Multipurpose Internet Mail Extensions is an Internet standard that extends the format of email to support:* Text in character sets other than ASCII* Non-text attachments* Message bodies with multiple parts...

 type 'image/jpeg' and the type code
Type code
A type code is the only mechanism used in pre-Mac OS X versions of the Macintosh operating system to denote a file's format, in a manner similar to file extensions in other operating systems. Codes are four-byte OSTypes...

 'JPEG'.

The operating system uses this information to generate a list of applications which are able to open each type. Within Finder
Finder
Finder may refer to:* Finder , a core component of the Apple Macintosh operating system, is the graphical representation of the computer's file system* Finder , a comic book series by Carla Speed McNeil...

 each file will be identified with a UTI and open with the default application for that type. The user may also select from a list of other applications which support the type.

Using this system, types are also associated with data for which there is no file name or the file extension is missing. This includes pasteboard data and data streaming over a protocol such as HTTP where a MIME type has been given.

Further reading

    1. The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK