CS3841
Operating Systems
# Introduction Please follow the <b>[lab handout](lab4res/CS3841Lab4CountingWordsPart2.pdf)</b>, including the <b>Specific Requirements</b>. For the lab report, the [Lab4 Checklist](lab4res/CS3841Lab4Checklist.pdf) is the final authority and could be in a different order and certainly has other minor differences from Dr. Schilling's <em>Deliverables</em> at the end of the lab handout. * Submit your report in hard-copy at the start of the week 4 lab period, with the [Lab4 Checklist](lab4res/CS3841Lab4Checklist.pdf) stapled on top of it. * Submit your code through github classroom by forking [the lab 4 repository (navigate to link within blackboard)](http://msoe.blackboard.com). Place the link to your github repository by your name on the first page after the checklist. For example, Phileas might write: <div align=center><big>Lab 4: A UNIX Word counter<br>Phileas Fogg</big><br> 1 Jan 2018<br> cs3841-2018-lab-2-foggp</div> I require a [more formal lab report](ReportStyle) this quarter than I usually do. # Resources * [Lab Handout](lab4res/CS3841Lab4CountingWordsPart2.pdf) * [Lab4 Checklist](lab4res/CS3841Lab4Checklist.pdf) * There are no videos to watch for this week's lab * Remember to `#include <unistd.h>` for pipe, read, write, fork, etc. * The [pipe](https://linux.die.net/man/2/pipe) command takes an array of two ints, which are the file descriptors for the two ends of the pipe. The index 0 position is for reading, the index 1 position is for writing. * You must create the pipe BEFORE forking so that the child processes can share it. * After creating the pipe, you can [read](https://linux.die.net/man/2/read) and [write](https://linux.die.net/man/2/write) to/from the pipe. You may want to create a small program that does this before using pipes in your larger program. * It is a good idea to call helper functions for the the parent and child code shortly after the fork to keep your code more modular <!--* YouTube: [](https://www.youtube.com/watch?v=) (Dr. Schilling)-->