------------------------------- CST8165 Lab Attendance Exercise #82 - Week 2 ------------------------------- -Ian! D. Allen - idallen@idallen.ca - www.idallen.com This is a very small program to complete and submit as your record of attendance in the lab this week. Using the Unix system calls read() and write(), create a main program and one function. The function receives two open Unix file descriptors as arguments. The function loops reading from the first descriptor and writing to the second descriptor with full error and EOF checking. (You don't have to worry about the write() failing to write all the data, since this toy program is not writing to sockets, it's writing to the file system.) Errors must cause the program to exit with a non-zero status, and the error messages must be output in the four-part format given in the Class Notes file programming_style.txt. The GNU error() function is a good way to output error messages (though it isn't portable to non-Linux platforms). Remember: EOF is not an error. The main program must call the function, passing it the descriptors for standard input and standard output. (No open() calls are needed - stdin and stdout are already open!) No command line arguments are needed. The submission command "cstsubmit" is documented in the class notes. Submit your completed and tested source file using this (exact) command line (spelling counts): $ ~alleni/bin/cstsubmit 82 mycopy.c