from Wikipedia, the free encyclopedia

As handle ( English for grip or handle ) is known in the computer science a unique reference value to a managed by the OS system resource such. B. Screen objects or individual files on hard drives. If an application program wants to use such a resource, by calling a suitable system function (for example, to open or create files) , it receives the reference as a return value that must be specified for further use of the resource by system functions (for example, to read from a file) .

The operating system checks when opening a resource access rights, sets - if needed - internal administrative structures needed to coordinate and further access attempts of other applications to the resource. If an application releases the resource again by calling Close , the management structures are cleared down again and the handle becomes invalid.

Other terms that have a more specific meaning depending on their use are, in addition to handle ( Microsoft Windows ), capability (academic) or descriptor ( POSIX ). The terminology is not consistent across different systems. For example, POSIX capabilities are not references to specific system resources but represent the permission to carry out a certain action.

If the system resource in question is a file, the handle is also known as the file handle or file descriptor .

A handle connects the identification of a system resource with access rights. For example, an application that opens a file through a system call with write permissions can subsequently execute write operations on the file by receiving the handle by specifying the handle as the target of the operation.

The principle can be illustrated by comparing it with a business reference in correspondence with authorities. As a citizen, you do not have direct access to the documents, but refer to the previous process by giving a business reference.

File handle

In programming with assembler and other programming languages, there are function calls for opening or creating files that return an integer. If this number is positive, then this is a handle to a file which can then be used for further operations with the file. In almost all implementations of the programming language C for today's operating systems get the standard streams stdin , stdoutand stderras a handle, the values 0, 1 or 2. However, this is not part of standard C, but will implement a UNIX operating systems, and then often adopted convention.

The NFS protocol for file access over a network uses file handles to address file operations.

Other meanings

In Matlab , placing the @symbol in front of a function creates a function handle that is comparable to function pointers in C, for example .

In the Windows API is HANDLE defined as data type, said further resource-specific types of data are derived therefrom (eg. B. HBITMAP or HBRUSH).

A handle system is used to assign and manage identifiers in the World Wide Web , which are also referred to as handles . Similar to the Domain Name System , a handle system in this sense represents a method for resolving namespaces . A corresponding application of such handles, which is better known in German-speaking countries, are digital object identifiers . Another system are the Persistent Uniform Resource Locators .


  • Sam Sun, Larry Lannom, Brian Boesch: Handle System Overview . RFC 3650 November 2003.
  • Sam Sun, Sean Reilly, Larry Lannom: Handle System Namespace and Service Definition . RFC 3651 November 2003
  • Sam Sun, Sean Reilly, Larry Lannom, Jason Petrone: Handle System Protocol (ver 2.1) Specification . RFC 3652 November 2003

Web links

Individual evidence

  1. Thomas W. Döppner: Operating Systems In Depth: Design and Programming . John Wiley & Sons, 2010, ISBN 0-471-68723-5 , pp. 20 ( limited preview in Google Book search).
  2. Archive link ( Memento of the original from July 7, 2013 in the Internet Archive ) Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. Handles on Windows (German) @1@ 2Template: Webachiv / IABot / www.htl-steyr.ac.at
  3. stackoverflow.com Brief description (English)
  4. Max Hailperin: Operating Systems And Middleware: Supporting Controlled Interaction . Cengage Learning, 2006, ISBN 978-0-534-42369-8 , pp. 242 ff . ( limited preview in Google Book search).
  5. ^ Richard Blum: Professional Assembly Language . Wrox, 2005, ISBN 0-7645-9561-X , pp. 457 ( limited preview in Google Book search).
  6. Peter Prinz, Ulla Kirch-Prinz: C: Introduction and professional application . S. 335 f . ( limited preview in Google Book search).
  7. ^ Aaron R. Bradley: Programming for Engineers . A Foundational Approach to Learning C and Matlab. Springer, 2011, ISBN 3-642-23302-3 , pp. 204 ( limited preview in Google Book search).
  8. Windows data types. msdn.microsoft.com (English)
  9. The Handle System - Corporation for National Research Initiative website (English)