Previous: Chapter 13
Up: Chapter 13
Previous Page: Chapter 13
Next Page: 13.1 Block Input/Output
So far, our interaction with the Operating System of the computer has been limited to using the compiler and shell to create executable files from our programs and execute them, as well as limited interaction with the File System to provide input data to our programs and store the output of results. All of our file I/O, either redirected standard input and output or direct using library functions such as fscanf() and fprintf(), has been with ASCII files using the formatted I/O utilities provided in C. In this chapter we look at an alternate method of doing I/O - block I/O, where a binary image of a data structure can be stored or retrieved. We discuss the library routines for performing block I/O and managing access to such files. We then provide an example program, a small data base system, which makes use of this facility.
Finally, we discuss other facilities provided by the C library for interacting with the shell from within a program, such as executing a shell command and command line arguments for our program.