Question: White a program using c++ using linux fuctions Description If you recall, the cat command takes a list of files as command line arguments, and

White a program using c++ using linux fuctions

Description

If you recall, the cat command takes a list of files as command line arguments, and then opens each file, dumping its contents to standard output, in the order the filenames were passed in.

You will be implementing this behavior.

Requirements

Your program must handle any number of files, which will have their filenames passed as command line parameters.

No matter how long each file is, your program must display all of the data inside.

If an input file is not a text file, make sure that all of the data is displayed. This means that you will not be able to use cout on its own to output the data.

You must use the UNIX system calls we spoke about in class to implement the reading portion. You can use them for the writing portion as well, but this is not required. This means that you cannot use the C++ file stream classes for the file input (open, read, close).

Make sure to clean up after you are done with each file, calling close on its file descriptor.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!