I/O Basics
- You should read chapters 4 and 5.
- These are very technical with lots of detail.
- You should do a first pass read to the the "feel" for the subject.
- As we cover the material you should go back and read again for content.
- I understand that there is way too much detail to get everything, but you need a foundation.
- This is system level I/O
- C++ style iostreams are built on top of this.
- C style scanf, printf, ... are built on type of this
- There are four basic system calls, plus a number of others.
- int open(const char *pathname, int flags, mode_t mode); and variants.
- int close(int fd);
- ssize_t read(int fd, void *buf, size_t count);
- ssize_t write(int fd, const void *buf, size_t count);
- All in part 2 of the manual
- Open is the most complex, with many many options and many ways to fail.
- Close is the easiest, one argument, only three errors.
- We will study these in more detail in the next set of notes.
- A modified example of code using these commands.