Managing streams, and reading and writing files
Each process in an operating system can interact with the data available on different devices connected to the operating system. Sample devices include files or network connections. Interaction with devices is done viastreams. A stream is a logical representation of a data transfer state.
In this recipe, we will show how to interact with the built-in system streams, as well as file streams, in Julia.
Getting ready
The way a program exchanges data with its environment is often called I/O, which stands for input/output. I/O operations are built into the Julia language. Hence, none of the typical installations is required to run these recipes; simply open the Julia command-line console.Â
Note
In the GitHub repository for this recipe, you will find the commands.txt
file, which contains the presented sequence of shell and Julia commands.
How to do it...
In this example, we will consider two cases—interacting with built-in process streams, and reading and...