[SOLVED] CSCI1730 - Breakout - Lab 06 - Cat

30.00 $

Category:

Description

5/5 - (1 vote)

For this lab, you will implement your own version of the cat systems program, a standard Unix utility that reads files sequentially, writing them to standard output. The name is derived from its function to concatenate files. The Single Unix Specification defines the operation of cat to read files in the sequence given in its arguments, writing their contents to the standard output in the same sequence. If one of the input filenames is specified as a single hyphen (-), then cat reads from standard input at that point in the sequence. If no files are specified, cat reads from standard input only. The command-syntax is:

$ ./cat [file_name…]

You are NOT allowed to use the exec, system, popen, and pclose system calls or functions in your implementation. You are not allowed to call the existing cat implementation. You must supply your own implementation that uses low-level I/O. Low-level file I/O (APUE Ch. 3) is a requirement for this breakout lab.

Hint: if you would like to check to see whether you have implemented cat correctly, then you could simply compare the behaviors of your cat program with the cat program on odin.