Basic I/O
Julia views its data in terms of a byte stream. This may be from/to standard input (stdin) or standard output (stdout), which may be superseded by a disk file.
If this is coming from a network socket or a pipe, this is essentially asynchronous, but the programmer doesn’t need to be aware of this as the stream will block until cleared by an I/O operation. The primitives are the read()
and write()
functions. They deal with binary data. With formatted data, such as text, several other functions are layered on top.
It provides very efficient operations both locally and over a distributed system (for example, a network) and is central to Julia’s efficient approach to I/O.
Terminal I/O
Previously, we mentioned that Julia has the concept of stdin and stdout. This is inherited from an idea in Posix-compliant operating systems. Its purpose is to stream data through I/O channels.
All streams in Julia have at least a read and a write routine; these take...