Files, Processes and Pipes
File Descriptors, Processes and Pipes, oh my!
For a more in-depth understanding of how processes and files work at the system level:
Read Chapter 0 of “xv6: a simple, Unix-like teaching operating system”
The xv6 operating system was developed at MIT for their operating systems engineering class. Chapter 0 of the documentation provides a really nice overview of what is going on at the system level when you run a command, redirect input/output, etc.
Self Study
-
This reading provides some insight about what is going on at the system layer when we start a program from the command line, redirect standard I/O, etc. Run a couple commands you are familiar with and think about what is going on at the system level when you run each one.
-
What is the relationship between the C standard I/O library calls such as
fputc
,fgetc
,fputs
, etc. and the system callsread
andwrite
? -
What is the relationship between the
FILE
type defined by the C standard libraries, and file descriptors. What does thefileno
library call do?