Computer Science 202
Systems Programming Concepts Using C
Lab 10 - Getting Information
Winter 1998


Write a C program to determine the number of files that are larger than 1000 bytes in the current directory.


Write a program that follows the outline given below:

  1. create a pipe
  2. fork a process
  3. re-direct standard out
  4. have child process issue the appropriate directory listing command
  5. have parent wait for child to finish
  6. convert a file descriptor to a file pointer
  7. read in the information generated by the directory listing command one line at a time
  8. determine which entries are larger than 1000 bytes


The following must be delivered to your instructor via text-only email by the end of class on 11th Tuesday March 17, 1998.

  1. Source code for your program.
In addition, you must deliver to the instructor by the end of lab on 11th Tuesday, March 17, 1998 the following:
  1. A printed copy of your source code.


  1. Since this is an in-class lab only minimal commenting is required.
  2. Make sure that you name is on the file.
  3. Meaningful variable names are required.
  4. I suggest you start with the program day.c handed out in class.