Question: c++ (create cat.cpp) implement your own version of the cat systems program, a standard Unix utility that reads files sequentially, writing them to standard output.

c++ (create cat.cpp) 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.

When user types in command cat filename.txt, it allows user to enter an input and the system will echo back the user input. When ctrl + d is pressed, it exits out of cat mode and displays the contents of the file.

When user types in command cat filename.txt file1.txt, it will concatenate the contents of file and file1 and display the contents of both files.

$ ./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 is a requirement.

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!