-
Book Overview & Buying
-
Table Of Contents
Systems Programming with Zig
By :
The tee(1) command is a tool that allows a single data stream to exist in two places at once: captured on disk and flowing live to the terminal. Implementing ztee challenges us to coordinate multiple output targets without blocking the flow of data, a task that perfectly demonstrates the composability of std.io interfaces. But first, let us understand the three fundamental and standard streams.
Every UNIX operating system has three files open all the time for its processes. UNIX uses file descriptors, which are non-negative integer values, as an internal representation for accessing open files, which is much prettier than using long paths. By default, all UNIX systems support three special and standard filenames: /dev/stdin, /dev/stdout, and /dev/stderr, which can also be accessed using file descriptors 0, 1, and 2, respectively. These three file descriptors are also called standard input...