Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Purpose The purpose of this assignment is to practice reading and writing from files using the UNIX system calls. You will be writing a basic

Purpose The purpose of this assignment is to practice reading and writing from files using the UNIX system calls. You will be writing a basic implementation of the cat command using C++. 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MongoDB Applied Design Patterns Practical Use Cases With The Leading NoSQL Database

Authors: Rick Copeland

1st Edition

1449340040, 978-1449340049

More Books

Students also viewed these Databases questions

Question

=+ 9. What is inflation and what causes it?

Answered: 1 week ago

Question

=+6. What does the invisible hand of the marketplace do?

Answered: 1 week ago