Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
File descriptor
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|System resource identifier in operating systems}} In [[Unix]] and [[Unix-like]] computer operating systems, a '''file descriptor''' ('''FD''', less frequently '''fildes''') is a process-unique identifier ([[Handle (computing)|handle]]) for a [[file (computing)|file]] or other [[input/output]] [[System resource|resource]], such as a [[pipe (Unix)|pipe]] or [[network socket]]. File descriptors typically have non-negative [[Integer (computer science)|integer]] values, with negative values being reserved to indicate "no value" or error conditions. File descriptors are a part of the [[POSIX]] [[application programming interface|API]]. Each Unix [[process (computing)|process]] (except perhaps [[daemon (computer software)|daemons]]) should have three standard POSIX file descriptors, corresponding to the three [[standard streams]]: {| class="wikitable" !Integer value !Name !{{mono|<[[unistd.h]]>}} symbolic constant<ref>{{cite web | url = http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html | title = The Open Group Base Specifications Issue 7, IEEE Std 1003.1-2008, 2016 Edition | author = The Open Group | access-date = 2017-09-21 | author-link = The Open Group }}</ref> !{{mono|<[[stdio.h]]>}} file stream<ref>{{cite web | url = http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdio.h.html | id = <stdio.h> | title = The Open Group Base Specifications Issue 7, IEEE Std 1003.1-2008, 2016 Edition | author = The Open Group | access-date = 2017-09-21 }}</ref> |- |0 |[[stdin|Standard input]] |{{mono|STDIN_FILENO}} |{{mono|stdin}} |- |1 |[[stdout|Standard output]] |{{mono|STDOUT_FILENO}} |{{mono|stdout}} |- |2 |[[stderr|Standard error]] |{{mono|STDERR_FILENO}} |{{mono|stderr}} |}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)