Fact-checked by Grok 2 weeks ago

Standard streams

Standard streams are pre-connected input and output communication channels between a computer program and its environment upon execution in Unix-like operating systems. These channels consist of three primary streams: standard input (stdin), standard output (stdout), and standard error (stderr), which are automatically opened for every process and associated with file descriptors 0, 1, and 2, respectively. By default, stdin reads from the keyboard, while stdout and stderr write to the terminal screen, though they can be redirected to files, other programs, or devices to facilitate modular program composition. Standard input (stdin), linked to file descriptor 0, serves as the for user or data input to a , often representing the in interactive environments. It allows programs to receive sequential data streams, enabling scripted or automated input without hardcoding values. Standard output (stdout), tied to 1, is the conventional destination for a 's regular results and informational messages, ensuring output is directed to the user's display unless otherwise specified. This text-based stream supports the portability of output across devices like monitors or printers. Standard error (stderr), connected to file descriptor 2, is a dedicated output stream for diagnostic, warning, or error messages, distinct from stdout to allow independent handling even if normal output is redirected. Like stdout, it defaults to the terminal but remains unbuffered for immediate visibility of issues. This separation prevents errors from being lost in redirected output, enhancing debugging in complex pipelines. The design of standard streams embodies the of treating everything as a file-like , promoting through simple text-based interfaces. They underpin essential mechanisms like redirection (e.g., > for files) and (| for ), allowing small tools to be chained into powerful workflows without custom protocols. Originating in the operating system and adopted in early Unix implementations, these streams have influenced programming languages and operating systems worldwide, remaining foundational in POSIX-compliant environments.

Fundamentals

Definition and Purpose

Standard streams refer to the three predefined (I/O) channels available to a program upon startup: standard input (stdin), standard output (stdout), and (stderr). These streams provide conventional mechanisms for reading input, writing normal output, and reporting diagnostic or error messages, respectively. In POSIX-compliant systems, stdin is designated for input with 0, stdout for output with descriptor 1, and stderr for errors with descriptor 2, ensuring a consistent across environments. The primary purpose of standard streams is to enable a simple, portable for flows, allowing programs to interact with their without hardcoding specific devices or files. This supports redirection of streams—such as stdout to another program's stdin or diverting stderr to a log file—without altering the program's core logic, thereby promoting in command-line pipelines and script compositions. is separated from standard output to allow independent redirection and handling of diagnostic messages, ensuring they remain visible even when normal output is redirected, such as to a printer or file. Key benefits include , where errors remain distinguishable from regular output for targeted handling; enhanced portability, as the streams adhere to standards and function consistently across operating systems; and efficient support for text-based processing, often through line-oriented operations suitable for human-readable data. In standard I/O libraries such as C's stdio, the streams associated with these file descriptors operate as buffered sequences of bytes or characters, minimizing system overhead by accumulating data in before transferring it to or from the underlying or . For , stdout and stdin are typically fully buffered when not connected to interactive devices like terminals, while stderr remains unbuffered to ensure immediate error reporting. This buffering model balances performance with the needs of interactive and non-interactive use cases.

Historical Origins

In the early days of electronic computing during the and 1950s, input and output operations were primarily handled through systems that relied on physical media such as punched cards and drives, rather than abstract stream concepts. These systems, used in like the and , processed jobs in sequential batches where programs and data were encoded on punched cards—rectangular stiff paper with holes representing —and fed into readers for execution, with output similarly recorded onto cards or tapes for later verification. This approach, dominant in environments like scientific and business , lacked the notion of continuous, multiplexed channels, as all I/O was mediated by offline peripherals to maximize machine utilization in operator-supervised setups. The introduction of high-level programming languages in the marked a significant step toward abstracting I/O, with playing a pivotal role under the leadership of at . Developed from 1954 to 1957, provided formatted capabilities through statements like READ and WRITE, which allowed programmers to specify data formats without directly managing low-level hardware details, such as card readers or line printers. However, these mechanisms treated input and output as unified operations without distinct channels for errors, reflecting the era's focus on reliable, sequential data flow in batch-oriented scientific computations. Backus's team emphasized practicality for mathematical applications, enabling code portability across hardware while simplifying I/O from the cumbersome assembly-language instructions of prior systems. Building on Fortran's innovations, , formalized in 1960 by an international committee including figures like John McCarthy and , advanced I/O toward procedural abstractions that foreshadowed stream-like models. The language deliberately omitted built-in I/O syntax to promote portability, instead delegating such operations to procedures within an environmental block, allowing implementations to adapt to diverse hardware without altering core syntax. This design choice, detailed in the Revised Report on ALGOL 60, emphasized machine-independent conventions, such as get and put procedures for reading and writing values, which laid conceptual groundwork for treating I/O as modular, procedure-driven flows rather than hardware-specific commands. The committee's focus on rigorous syntax and semantics influenced subsequent systems, evolving eventually into the distinct stream abstractions seen in Unix by the 1970s.

Core Streams

Standard Input (stdin)

Standard input, commonly referred to as stdin, serves as the primary channel through which programs receive data during execution. In operating systems, stdin is predefined as file descriptor 0, a low-level that the associates with an open or , allowing processes to read input bytes sequentially. By , this stream is connected to the for interactive input, enabling users to supply data directly to running programs, though it can be redirected to files, pipes, or other sources. Programs access stdin through system calls or library functions designed for reading, such as the POSIX-compliant read() function, which retrieves a specified number of bytes into a . Reads from stdin can operate in blocking mode, where the calling suspends execution until becomes available or an (EOF) condition is reached, ensuring reliable flow for sequential processing. Alternatively, non-blocking reads, enabled by setting the O_NONBLOCK flag on the via fcntl(), return immediately if no is available, returning -1 with errno set to EAGAIN, which is useful for asynchronous or event-driven applications to avoid indefinite waits. EOF detection occurs when read() returns 0 bytes, signaling that the input source has been exhausted, such as when a piped terminates or an interactive session receives a specific signal like Ctrl+D on Unix terminals. Common applications of stdin include interactive prompts, where programs like shells or utilities query users for input, such as entering commands or responses in a loop until EOF. For , stdin facilitates reading from files or inter-process ; for instance, the utility can display the contents of a file by redirecting it to stdin with the command cat < file.txt, where the shell connects the file to file descriptor 0 before invoking the program. This piping mechanism allows chaining commands, like ls | grep pattern, where the output of ls feeds directly into grep's stdin for filtering. Portability challenges with stdin arise from varying conventions across systems, particularly in handling line endings and character encodings. POSIX standards define the newline character as the line feed (LF, ASCII 10), treating text streams as sequences of lines terminated by LF, which can lead to issues when processing files from Windows systems that use carriage return-line feed (CRLF, ASCII 13 followed by 10) pairs, potentially causing extra blank lines or malformed input if not normalized. Encoding assumptions further complicate matters, as many Unix tools default to assuming ASCII or UTF-8 for stdin, but legacy systems or cross-platform transfers may introduce locale-specific multibyte encodings, requiring explicit handling with functions like setlocale() to ensure correct interpretation of non-ASCII data.

Standard Output (stdout)

Standard output, commonly referred to as stdout, serves as the primary stream for conveying a program's normal results and data to the external environment. In systems, it is predefined with file descriptor 1, enabling programs to write output reliably across processes and shells. By default, stdout directs data to the console or terminal for immediate display, but it supports redirection to files, pipes, or subprocesses, which facilitates composable command-line workflows without altering program logic. Operations on stdout incorporate buffering to balance efficiency and responsiveness. When directed to a non-interactive destination, such as a file, the stream employs full buffering, accumulating data in blocks (typically 4-8 KB) before transferring it to the underlying system, thereby minimizing I/O calls. For interactive contexts like terminals, line buffering is standard, where output flushes automatically after each newline, ensuring timely visibility; manual flushing can be invoked to handle urgent writes in fully buffered scenarios. Stdout finds widespread application in logging results from computations and producing reports for further processing. A representative example is the shell redirection echo "Hello World" > output.txt, which captures the program's textual output in a file rather than printing it to the screen, supporting tasks like data export in scripts. In terms of performance, in POSIX environments stdout handles unprocessed byte streams without implicit newline conversions or mode-specific distinctions between text and binary, supporting efficiency for both textual and non-textual data.

Standard Error (stderr)

The standard error stream, commonly referred to as stderr, is a predefined input/output communication channel in POSIX-compliant systems, declared as extern FILE *stderr in the <stdio.h> header and associated with the file descriptor STDERR_FILENO, defined as 2 in <unistd.h>. This stream is automatically available at program startup without needing explicit opening and is expected to support both reading and writing operations. By default, stderr operates in an unbuffered mode, meaning output is written immediately to the underlying rather than being held in a , which contrasts with the fully buffered behavior of standard output streams under non-interactive conditions. This design ensures that diagnostic information appears promptly, avoiding delays that could hinder debugging or user interaction, especially in scenarios involving pipelines where stderr coordinates with stdin and stdout for error handling. The core purpose of stderr is to convey diagnostic output, including error messages, warnings, and other non-normal program responses, thereby isolating them from regular data output on stdout. For example, tools like the route compilation errors and warnings exclusively to stderr, preventing them from intermingling with generated or successful output streams. This separation facilitates targeted processing, such as filtering or diagnostics without affecting primary results. In shell environments, stderr supports independent redirection to files or other streams using notation. The syntax command 2> errors.log redirects stderr to a specified file, while command > output.log 2>&1 merges stderr with stdout for combined . These operations leverage the stream's 2, allowing precise control in scripts and command pipelines. Best practices for stderr usage focus on its unbuffered characteristics to guarantee immediate visibility, recommending output of warnings and errors to this stream while reserving stdout for informational or progress messages. Additionally, integrating levels—such as "warn" for non-fatal issues and "error" for failures—enhances diagnostics, aligning with conventions in systems like Unix where stderr handles severity-based reporting to support effective troubleshooting.

Practical Applications

Command-Line and Shell Usage

In command-line interfaces and shell environments such as and Zsh, standard streams are manipulated using redirection operators to alter the flow of input and output for commands. The operator < redirects standard input (stdin) from a , allowing a command to read from that file instead of the keyboard; for example, sort < data.txt sorts the contents of data.txt []. The > operator redirects standard output (stdout) to a , overwriting its contents if it exists, as in ls > listing.txt which writes the directory listing to listing.txt rather than displaying it on []. Similarly, >> appends stdout to a without overwriting, useful for logging []. For (stderr), the 2> operator redirects error messages to a file, such as command 2> errors.log to capture diagnostics separately []. In Zsh, these operators function identically to , adhering to standards for basic redirection []. Multiple redirections can be combined, like command > output.txt 2>&1 to merge stderr into stdout and redirect both to a []. Piping, denoted by the | operator, connects the stdout of one command directly to the stdin of the next, enabling command chaining without intermediate files. This POSIX-compliant feature allows efficient data processing ; for instance, ls | [grep](/page/Grep) "file" lists directory contents and filters lines containing "file" using []. Each command in a pipeline runs in a subshell, with pipes facilitating asynchronous execution in modern shells like []. Complex pipelines can involve multiple stages, such as cat data.txt | sort | uniq to sort and deduplicate lines from a []. Advanced stream manipulation includes the utility, which reads from stdin and writes simultaneously to stdout and one or more files, effectively splitting streams for or . As a standard command, tee is invoked like command | tee log.txt to display output on the terminal while saving it to log.txt []; the -a option appends to files instead of overwriting []. Process substitution, a and Zsh extension, treats command output as a temporary file for redirection; for example, diff <(sort file1.txt) <(sort file2.txt) compares sorted versions of two files without creating physical temporaries, leveraging named pipes or /dev/fd mechanisms []. Shell builtins provide programmatic control over streams in scripts. The set -e option in Bash and Zsh causes the shell to exit immediately if any command returns a non-zero status, often due to stderr emissions indicating errors, thus trapping failures early in script execution []; this can be combined with redirection for robust error handling, such as redirecting stderr in critical sections []. Other builtins like exec allow reassigning streams globally within a script, for instance exec 2> /dev/null to suppress all stderr output thereafter []. These features enhance scripting reliability in command-line workflows [].

Programming Language Implementations

In , standard streams are accessed through the <stdio.h> header, which defines three predefined streams of type FILE*: stdin for input, stdout for output, and stderr for error messages. These streams are opened automatically when the program starts and can be manipulated using functions like fopen() to open additional files as streams, fread() and fwrite() for transfer, and perror() specifically for printing error descriptions to stderr based on the errno value. For example, the code snippet perror("File open failed"); outputs a descriptive message to stderr if an error occurred, aiding in debugging without altering the main output stream. This buffered I/O model allows efficient handling of text and , with stdin, stdout, and stderr typically bound to file descriptors 0, 1, and 2, respectively. Python provides direct access to standard streams via the sys module, where sys.stdin, sys.stdout, and sys.stderr are file-like objects representing the input, output, and error streams. These can be read from or written to using methods like read() and write(), enabling low-level control over I/O operations. Higher-level wrappers include the built-in print() function, which writes formatted output to sys.stdout by default with automatic newline handling and optional parameters for separators and flushing, and the input() function, which reads a line from sys.stdin and strips the trailing newline. For instance, print("Hello, world!", file=sys.stderr) redirects the message to the error stream, useful for logging warnings separately from normal output. This design supports both interactive scripting and piped data processing in Python 3.x. In Java, the System class exposes standard streams as static fields: System.in of type InputStream for reading raw bytes from input, System.out and System.err of type PrintStream for writing formatted text or bytes to output and error streams, respectively. The InputStream interface provides methods like read() for byte-level input, often wrapped in higher-level classes such as Scanner for parsing, while PrintStream offers convenience methods like println() that handle encoding and automatic flushing without throwing I/O exceptions. Developers can redirect these streams using System.setIn(), System.setOut(), and System.setErr() for testing or logging, ensuring System.err remains unbuffered for immediate error visibility. This approach integrates seamlessly with Java's object-oriented I/O hierarchy, promoting portability across platforms. The .NET framework, including C# applications, utilizes the Console class in the System namespace to manage standard streams through properties Console.In (a TextReader for input), Console.Out (a TextWriter for output), and Console.Error (a TextWriter for errors). These are typically implemented as StreamReader for reading character-encoded input from stdin and StreamWriter for writing to stdout or stderr, supporting methods like ReadLine() and WriteLine() for line-based operations with built-in encoding handling (defaulting to UTF-8 in .NET 8). Redirection is possible via Console.SetIn(), Console.SetOut(), and Console.SetError(), allowing streams to be reassigned to files or custom writers for scenarios like unit testing. This abstraction layer ensures consistent behavior in console applications while leveraging the underlying Stream classes for binary I/O when needed.

Evolution Across Systems

Early Languages (1950s-1960s)

In the mid-1950s, I and II pioneered high-level operations in programming languages through simple READ and WRITE statements, which enabled programmers to transfer data in a specified sequence from cards, tapes, or printers without needing low-level machine instructions. These statements supported basic formatting for numeric and alphanumeric data but were inherently machine-dependent, tying I/O directly to specific hardware devices like the IBM 704. No provision existed for distinct error streams; instead, I/O failures were managed implicitly through program halts or rudimentary status checks via the compiler's . ALGOL 60, released in 1960, advanced I/O abstraction by defining it as a set of parameterized procedures, such as ininteger(p, x) for reading an into variable x from a specified by parameter p, and corresponding output procedures like outinteger. This design separated I/O logic from the core language syntax, allowing implementations to adapt procedures to local hardware while maintaining syntactic portability across systems. By treating as parameters, influenced the development of more flexible I/O in later languages, emphasizing procedural modularity over hardcoded access. ALGOL 68, finalized in 1968, further refined stream concepts by introducing modes—a strongly typed system that included the channel mode for I/O operations, defined as a structure encapsulating procedures like get and put for reading and writing data. This mode enforced on I/O channels, preventing mismatches between data types and stream formats, and allowed programmers to declare custom modes for specialized behaviors, such as buffered or formatted streams. Unlike its predecessors, ALGOL 68's typing extended to I/O, reducing runtime errors from type incompatibilities in data transfer. A key limitation across these early languages was the absence of standardized separation between normal output and error reporting; I/O errors, such as conditions or device failures, were typically handled through system calls or ignored, relying on the host operating system's interrupts rather than language-level streams for diagnostics. Precursors in batch systems, where input came from punched cards and output went to line printers, reinforced this sequential, non-interactive model without dedicated error channels.

Unix and C Era (1970s)

In the early 1970s, and at developed the Unix operating system, fundamentally shaping standard streams through its model. Every Unix process begins with three predefined open descriptors: 0 for standard input, 1 for standard output, and 2 for standard , treating all uniformly as operations to enable interaction with files, devices, and . This originated in the initial Unix versions on the , where descriptors 0 and 1 handled input and output, respectively, with standard added in the 6th Edition release of May 1975 to separate diagnostic messages from regular output, preventing pipelines from being disrupted by errors. A key innovation was the pipe() system call, introduced in the 3rd Edition of Unix in February 1973, which allowed the output of one process (via descriptor 1) to serve as input to another (via descriptor 0), facilitating modular command chaining without intermediate files. The , also created by Ritchie in the early 1970s, built upon this foundation with its formalized in 1978. The header file stdio.h defined macros for stdin, stdout, and stderr as pointers attached to file descriptors 0, 1, and 2, providing buffered I/O functions like the fprintf family for formatted output to these streams. This abstraction layer in the first edition of by and Ritchie enabled portable, high-level stream handling across Unix systems, with functions such as directing output to stdout by default and perror to stderr for reporting. handling was supported via the errno , set by system calls and library functions to indicate specific failure codes (e.g., ENOENT for "no such file"), allowing programs to diagnose issues without altering stream contents. Shell innovations further standardized stream manipulation. The , developed by Stephen Bourne and released with the 7th Edition of Unix in 1979, introduced redirection operators like > for stdout to files, < for stdin from files, and 2> for stderr, enabling users to reassign streams flexibly at the command level. These features, building on earlier capabilities, allowed constructs such as command > file 2>&1 to merge error and output streams, promoting script portability and error isolation in pipelines. By the late 1970s, Unix's stream model had demonstrated significant portability, running on diverse hardware like the PDP-11 and VAX without major rewrites, laying groundwork for emerging efforts that emphasized consistent I/O interfaces across implementations. This era's conventions, codified in C and tools, influenced subsequent systems by prioritizing simplicity, unification of I/O, and for errors, ensuring streams became a cornerstone of operating systems.

Modern Frameworks (1990s-2000s)

In the 1990s and 2000s, standard streams evolved within object-oriented and managed runtime environments, abstracting the foundational Unix model into higher-level classes that emphasized portability, type safety, and integration with garbage collection. These frameworks introduced hierarchical stream abstractions, allowing developers to handle operations through polymorphic interfaces while maintaining compatibility with underlying system streams. This period marked a shift toward cross-platform , where streams were wrapped in language-specific objects to simplify error management and data transformation. Java, first released in 1995, implemented standard streams through the java.io package, which provides abstract base classes like InputStream for reading bytes and OutputStream for writing bytes, forming the foundation for both byte-oriented and character-oriented I/O. The class exposes these as static singleton fields: System.in as an InputStream for standard input, and System.out and System.err as PrintStream instances for standard output and error, respectively, which are pre-initialized and thread-safe by default. This design enabled seamless integration with Java's , supporting buffered and filtered subclasses for efficient data handling across diverse operating systems. The .NET Framework, introduced in 2002, organized stream functionality in the , offering abstract classes for sequential data access alongside specialized types like StreamReader and StreamWriter for text handling. are accessible via the Console class, which manages In (TextReader for input), Out (TextWriter for output), and Error (TextWriter for errors), with built-in support for character encodings through the class, including as a common default for console operations. This framework's managed environment ensured automatic resource cleanup via the using statement, enhancing reliability in Windows-centric applications. Python's evolution during this era saw significant refinements in stream handling, with Python 2.0 (2000) relying on built-in file objects for I/O, where strings were treated as byte sequences by default, complicating Unicode operations. Python 3.0 (2008) introduced the io module as the standard interface, providing TextIOWrapper for unicode-aware text streams and BytesIO for binary data, with sys.stdin, sys.stdout, and sys.stderr reimplemented as io.TextIOBase instances that default to locale-based encoding but support explicitly for . This shift separated bytes and text types, reducing encoding errors in global applications. Key enhancements across these frameworks included exception-based error handling, where I/O failures—such as or device errors—triggered dedicated exceptions like Java's IOException, .NET's IOException, or Python's OSError, allowing precise catch-and-recover patterns over return-code checks. Internationalization advanced through native support: via Charset decoders/encoders, .NET through Encoding.UTF8 for stream wrappers, and Python 3 with surrogateescape error handling on standard streams to preserve invalid sequences. These features promoted robust, locale-agnostic stream usage in diverse software ecosystems.

Integration with GUIs

Graphical user interface (GUI) environments present significant challenges for standard streams, as applications are typically initialized without an attached console, causing output directed to stdout and stderr to become invisible or discarded unless explicitly redirected. This absence of a terminal necessitates adaptations such as integrating logging frameworks to capture and manage stream data. In Java, for example, developers can implement custom PrintStream subclasses that route System.out and System.err to the java.util.logging.Logger API, enabling output to be logged to files, displayed in GUI components, or processed asynchronously without relying on a console. Similarly, in other languages, libraries like Log4j allow interception of stderr via custom OutputStream implementations tied to GUI text areas or persistent logs, addressing the event-driven nature of GUIs where blocking I/O operations must be avoided. On Windows, GUI applications—subsystem "windows" in executable headers—do not inherit console handles by default, but the Win32 provides AllocConsole() to allocate a new console dynamically at . This function creates a window and initializes the standard input (stdin), standard output (stdout), and (stderr) handles, allowing developers to perform stream-based I/O such as printf() or cin/cout operations directly to the console from within the GUI . Once allocated, streams can be manipulated using standard C functions or redirected further if needed, though care must be taken to free the console with FreeConsole() to avoid resource leaks. This approach is particularly useful for or hybrid applications that mix GUI and CLI behaviors. Cross-platform GUI toolkits like and facilitate stream-like I/O through bindings and custom redirection mechanisms tailored to their event-driven architectures. In , developers can subclass QIODevice or replace the stream buffer of std::cout with a custom implementation that appends output to widgets such as QTextEdit or QPlainTextEdit, ensuring thread-safe updates via to integrate console-style into the GUI without blocking the main . 's QProcess class further supports capturing stdout and stderr from child processes for display in GUI elements. Similarly, applications can redirect standard streams to GtkTextView widgets by overriding the default output streams with GIOChannel-based handlers or using g_spawn_async_with_pipes() to pipe external process output directly into the GUI, maintaining responsiveness in event-driven contexts. These bindings emphasize non-blocking I/O to align with the toolkits' signal-based paradigms. Modern trends in web-based and hybrid environments extend standard streams to browser consoles via technologies like (WASM) and , bridging CLI-like behaviors to contexts. In , modules compiled with or WASI can redirect stdin, stdout, and stderr to callbacks that log to the browser's console, using like console.log() or custom DOM elements for real-time display, as seen in tools that emulate terminal I/O for ported CLI applications. For applications, which embed and , process.stdout and process.stderr naturally integrate with the browser's console for debugging, while environment variables like ELECTRON_NO_ATTACH_CONSOLE allow capturing streams without attaching to a system console, enabling seamless output to in-app web views or DevTools. These approaches support running legacy CLI code in wrappers, with streams emulated through streams for bidirectional communication.

References

  1. [1]
    [PDF] Unix file abstraction
    The streams stdin, stdout, and stderr are automatically set up to refer to buffer data from/to file descriptors 0, 1, and 2, respectively. Page 12. The stdout ...<|control11|><|separator|>
  2. [2]
    Input Streams :: CC 210 Textbook
    Jul 13, 2023 · Standard Streams · stdin - this is the standard input stream that is used to receive input from the keyboard. · stdout - this is the standard ...
  3. [3]
    Standard Input and Output Streams
    The stream known as standard input generally represents the keyboard and is the basic source of user input to text-based programs.
  4. [4]
    103.4 Lesson 1 - Linux Professional Institute – Learning
    The numerical file descriptors assigned to these channels are 0 to stdin, 1 to stdout and 2 to stderr. Communication channels are also accessible through the ...
  5. [5]
    Standard Output Definition - The Linux Information Project
    These standardized streams, which consist of plain text, make it very easy for the output from such programs to be sent to a devices (e.g., display monitors or ...
  6. [6]
    Standard Error Definition - The Linux Information Project
    May 12, 2005 · Standard error, abbreviated stderr, is the destination of error messages from command line (ie, all-text mode) programs in Unix-like operating systems.
  7. [7]
    Standard Streams and I/O Redirection
    standard error ( stderr ): Standard error is another output stream typically used by programs to output error messages or diagnostics. It is a stream ...
  8. [8]
    Pipes, redirection, and standard out and in
    Jan 19, 2015 · These jargony terms refer to streams of data, standardized as plain text. When McIlroy refers to text streams as "universal interface", he means ...
  9. [9]
    Standard I/O Streams
    A stream is associated with an external file (which may be a physical device) by opening a file, which may involve creating a new file.Missing: POSIX | Show results with:POSIX
  10. [10]
    System Interfaces Chapter 2
    2.5 Standard I/O Streams ... A stream is associated with an external file (which may be a physical device) by ``opening'' a file, which may involve ``creating'' a ...
  11. [11]
    stdin(3): standard I/O streams - Linux man page - Die.net
    Under normal circumstances every UNIX program has three streams opened for it when it starts up, one for input, one for output, and one for printing diagnostic ...
  12. [12]
    stdin(3) - Linux manual page - man7.org
    The input stream is referred to as "standard input"; the output stream is referred to as "standard output"; and the error stream is referred to as "standard ...Synopsis Top · Description Top · Notes Top<|control11|><|separator|>
  13. [13]
    The IBM punched card
    The punched card preceded floppy disks, magnetic tape and the hard drives of later computers as the first automated information storage device, increasing ...Missing: standard output batch
  14. [14]
    Punch Card - an overview | ScienceDirect Topics
    Punched cards and later paper tape used paper products with punched holes to represent data. Punched cards were first devised for Jacquard's loom to control the ...
  15. [15]
    A History of Operating Systems
    Jan 18, 2002 · The idea behind it was to collect a tray full of jobs in the input room and then read them onto a magnetic tape using a small (relatively) ...
  16. [16]
    [PDF] The History of Fortran I, II, and III by John Backus
    This article discusses attitudes about "automatic programming," the eco- nomics of programming, and existing programming systems, all in the early. 1950s. It ...
  17. [17]
    IBM Develops the FORTRAN Computer Language | Research Starters
    FORTRAN (FORmula TRANslating system)—the first widely accepted, high-level computer language—was delivered by John Backus and colleagues at IBM in April, 1957.
  18. [18]
    Computer - Programming, FORTRAN, IBM - Britannica
    Oct 17, 2025 · In the early 1950s John Backus convinced his managers at IBM to let him put together a team to design a language and write a compiler for it ...
  19. [19]
    A proposal for input-output conventions in ALGOL 60
    The ALGOL 60 language as first defined made no explicit reference to input and output processes. Such processes appeared to be quite dependent on the ...
  20. [20]
    [PDF] ALGOL 60 - Software Preservation Group
    Introduction. For the history of ALGOL 60 up to April 1962, the Revised Report ... Report on Input-Output Procedures for ALGOL 60, Num. Math., Vol. 6, p. 459 ...Missing: portability | Show results with:portability
  21. [21]
    [PDF] AB38.3.1 A commentary on the ALGOL 60 Revised Report R.M. De ...
    The environmental block contains procedure declarations of standard functions, input and output operations, and possibly other operations to be made available ...
  22. [22]
    stdin
    Standard output value, stdout. Its value is 1. STDERR_FILENO: Standard error value, stderr. Its value is 2. These file descriptors are often all associated with ...
  23. [23]
    General Terminal Interface
    If the O_NONBLOCK flag is clear, then the read request is blocked until data is available or a signal has been received. If the O_NONBLOCK flag is set, then ...
  24. [24]
    read(2) - Linux manual page - man7.org
    read() attempts to read up to count bytes from file descriptor fd into the buffer starting at buf. On files that support seeking, the read operation commences ...
  25. [25]
    cat(1p) - Linux manual page - man7.org
    The cat utility shall read files in sequence and shall write their contents to the standard output in the same sequence.
  26. [26]
    stdin
    Standard input value, stdin. Its value is 0. STDOUT_FILENO: Standard output value, stdout. Its value is 1. STDERR_FILENO: Standard error value, stderr. Its ...
  27. [27]
    2. Shell Command Language
    The shell is a command language interpreter. This chapter describes the syntax of that command language as it is used by the sh utility and the system() and ...Missing: txt | Show results with:txt
  28. [28]
    Buffering Concepts (The GNU C Library)
    Newly opened streams are normally fully buffered, with one exception: a stream connected to an interactive device such as a terminal is initially line buffered.Missing: modes | Show results with:modes
  29. [29]
    Standard input, standard output, and standard error files - IBM
    Your screen is the standard output, sometimes denoted as stdout. By default, commands take input from the standard input and send the results to standard output ...
  30. [30]
    stdin
    ### Summary of stderr from https://pubs.opengroup.org/onlinepubs/9699919799/functions/stderr.html
  31. [31]
    <unistd.h>
    ### Summary of STDERR_FILENO and Standard File Descriptors from `<unistd.h>`
  32. [32]
    stderr(3): standard I/O streams - Linux man page - Die.net
    The standard streams can be made to refer to different files with help of the library function freopen(3), specially introduced to make it possible to reassign ...
  33. [33]
    The history of Fortran I, II, and III - ACM Digital Library
    The input-output statements provided included the basic notion of specifying the se- quence in which data was to be read in or out, but did not include any " ...
  34. [34]
    Report on Input-Output Procedures for ALGOL 60 - ACM Digital Library
    Procedures inarray and outarray also form a pair; they transfer the ordered set of numbers forming the value of the array given as the second parameter, the ...
  35. [35]
    ALGOL 60 at 60: The greatest computer language you've never ...
    May 15, 2020 · "It had the world's most exotic input output system," Herbert laughed. It was also, sadly for its enthusiasts, a bit of a dead end. Despite ...Missing: procedures history
  36. [36]
    [PDF] Informal Introduction to ALGOL 68 - Hal-Inria
    Nov 27, 2020 · ALGOL 68 modes where this facility would be useful are: int, real ... Observe that channel is actually a new mode. Implementations will.
  37. [37]
    [PDF] The Algol 68 Jargon File
    Consider for example the mode channel, which part of the standard transput: mode channel = struct (proc(ref book)bool reset, set, get, put, bi, compress ...
  38. [38]
    [PDF] Chapter 2 History of Programming Languages
    Sep 15, 2005 · Languages. Topics. Early History: low level languages. The 1950s: first programming languages. The 1960s: an explosion in programming languages.<|control11|><|separator|>
  39. [39]
    [PDF] The UNIX Time- Sharing System
    Pro- grams executed by the Shell, however, start off with two open files which have file descriptors 0 and 1. As such a program begins execution, file 1 is open ...Missing: streams history
  40. [40]
  41. [41]
    Unix Is Born and the Introduction of Pipes - CSCI-E26
    (35) McIlroy concurs, describing how the initial effort to add pipes to Unix occurred about the same time in 1969 that Ritchie, Thompson and Canaday were ...
  42. [42]
    Inside the C Standard Library - begriffs.com
    Jan 19, 2019 · By February 1978 core C practice had stabilized to the point where Kernighan and Ritchie codified it in the first edition of their book The C ...
  43. [43]
    [PDF] The C programming language. - RetroFun.PL
    C was originally designed for and implemented on the UNIXT operating system on the DEC PDP-I1, by Dennis Ritchie. The operating system, the.
  44. [44]
    traditional Bourne shell family / history and development
    The Bourne shell, introduced with the "7th edition" of Unix in 1979, is an important part of the Unix history. Its grammar is the core of several modern shells.Content · 1. Introduction · 2. All The VariantsMissing: 1977 | Show results with:1977
  45. [45]
    Evolution of the Unix Time-sharing System - Nokia
    The shell closed all its open files, then opened the terminal special file for standard input and output (file descriptors 0 and 1). 2): It read a command line ...
  46. [46]
    The enviable pedigree of UNIX and POSIX - OSnews
    Feb 2, 2017 · UNIX was among the first truly portable systems, running on disparate processor types with different word sizes by the late 1970s. [q]. The ...
  47. [47]
    The UNIX System -- History and Timeline - UNIX.org
    The history of UNIX starts back in 1969, when Ken Thompson, Dennis Ritchie and others started working on the "little-used PDP-7 in a corner" at Bell Labs and ...
  48. [48]
    Package java.io - Oracle Help Center
    Package java.io provides for system input and output through data streams, serialization and the file system.
  49. [49]
    System (Java Platform SE 8 ) - Oracle Help Center
    The System class are standard input, standard output, and error output streams; access to externally defined properties and environment variables.
  50. [50]
    File and Stream I/O - .NET - Microsoft Learn
    The System.IO namespace also provides types for reading encoded characters from streams and writing them to streams. Typically, streams are designed for byte ...Missing: Console | Show results with:Console
  51. [51]
    Console Class (System) | Microsoft Learn
    The Console class represents the standard input, output, and error streams for console applications. This class cannot be inherited.
  52. [52]
    Encoding Class (System.Text) | Microsoft Learn
    The following example converts a string from one encoding to another. Note: The byte[] array is the only type in this example that contains the encoded data.
  53. [53]
    What's New in Python 2.7 — Python 3.14.0 documentation
    This article explains the new features in Python 2.7. Python 2.7 was released on July 3, 2010. Numeric handling has been improved in many ways.
  54. [54]
    io — Core tools for working with streams — Python 3.14.0 ...
    sys. contains the standard IO streams: sys.stdin , sys.stdout , and sys.stderr . Class hierarchy¶. The implementation of I/O streams is organized as a ...<|separator|>
  55. [55]
    What's New In Python 3.0 — Python 3.14.0 documentation
    The io module is now the standard way of doing file I/O. The built-in open() function is now an alias for io.open() and has additional keyword arguments ...What's New In Python 3.0 · Common Stumbling Blocks · Text Vs. Data Instead Of...
  56. [56]
    InputStream (Java Platform SE 8 ) - Oracle Help Center
    Reads the next byte of data from the input stream. The value byte is returned as an int in the range 0 to 255.
  57. [57]
    2 Supported Encodings - Java - Oracle Help Center
    The default charset is UTF-8. However, in JDK 17 and earlier releases, the default charset depends on the host and the user. Standard Java APIs use the default ...
  58. [58]
    How to use character encoding classes in .NET - Microsoft Learn
    Sep 15, 2021 · This article explains how to use the classes that .NET provides for encoding and decoding text by using various encoding schemes.
  59. [59]
    sys — System-specific parameters and functions — Python 3.14.0 ...
    This module provides access to some variables used or maintained by the interpreter and to functions that interact strongly with the interpreter.Sys.monitoring · Python Runtime Services · Fileinput · Audit events table
  60. [60]
    Writing Java classes to redirect JVM stdout and stderr output - IBM
    Use the USEROUTPUTCLASS option in a JVM profile to name a Java class that intercepts the stdout stream and stderr stream from the JVM.
  61. [61]
    How to intercept and log stdout and stderr messages with log4j
    Log4j doesn't allow to catch stdout and stderr messages out of the box. However, you can still intercept them with a custom output stream.
  62. [62]
    AllocConsole function - Windows Console - Microsoft Learn
    Dec 29, 2021 · AllocConsole initializes standard input, standard output, and standard error handles for the new console.
  63. [63]
    Debugging Techniques | Qt 6.10 - Qt Documentation
    On Windows, GUI applications are not attached to a console, so output written to stdout and stderr is not visible to the user. IDEs typically redirect and ...<|separator|>
  64. [64]
    Re: redirecting stdout to gtk_text widget - GNOME
    Feb 7, 2006 · I am writing a gui using GTK libraries.I need to be able to redirect text that is going to stdout through the printf's to my text widget.
  65. [65]
    Consoles with C/C++ WebAssembly (stdio, stderr, more)
    This section describes how to use twr-wasm to: create input/output consoles for use by C/C++ with WebAssembly; direct stdin, stdout and stderr to a console; use ...
  66. [66]
    How to capture the stdout stream of an electron application in ...
    Jan 24, 2017 · In the windows command prompt, I needed to run the following command: set ELECTRON_NO_ATTACH_CONSOLE=true. This results in console.log and process.stdout.write ...