Chapter 5: Working with File I/O and Filesystem Operations
File I/O is an important part of system programming since most programs must read or write data to and from files. Doing file I/O also requires the developer to know a thing or two about the filesystem.
Mastering file I/O and filesystem operations will make you not only a better programmer but also a better system administrator.
In this chapter, we will learn about the Linux filesystem and inodes. We will also learn how to read and write files on the system, using both streams and file descriptors. We will also look at system calls to create and delete files and change file permissions and ownership. At the end of the chapter, we will learn how to fetch information about files.
In this chapter, we will cover the following recipes:
- Reading inode information and learning the filesystem
- Creating soft links and hard links
- Creating files and updating the timestamp
- Deleting files
- Getting access rights...