Version 1 of stdio

Updated 2003-04-08 17:37:22

During the early development of C, one of the design decisions made was to move file input and output out of the language and into a series of standard library function calls. This application programming interface (aka API) is known as stdio.

Unfortunately, in the beginning, no formal specifications for stdio were available. Instead, the API and a brief description existed, and, for those fortunate to have access to the original Bell Labs source, an implementation in C was available.

However, the basic concept is this.

  • A series of functions for opening, reading, writing, seeking, and closing handles to files were defined.
  • when an application is opened, 3 file handles are opened by default
  • an input file, known as stdin, is opened
  • an output file, known as stdout, is opened
  • an error file, known as stderr, is opened
  • On Unix at least, the goal was that nearly any file - plain, device, pipe, etc. - would look to an application like any other as far as open/read/write/etc. were concerned. Over time, special functions such as ioctl, directory read and writing functions, etc. have evolved.

Category Concept |