December 2020
Intermediate to advanced
388 pages
7h 52m
English
In the previous chapter, we looked at the details of how Rust uses memory, a key system resource.
In this chapter, we will look at how Rust interacts with another important class of system resources – files and directories. The Rust Standard Library offers a rich set of abstractions that enable platform-independent file and directory operations.
For this chapter, we will review the basics of how files are managed by Unix/Linux, and master the key APIs that the Rust Standard Library provides to deal with files, paths, links, and directories.
Using the Rust Standard Library, we will implement a shell command, rstat, that counts the total number of lines of Rust code in a directory (and its ...
Read now
Unlock full access