Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ create a cat.cpp. I HAVE BEEN GETTING WRONG ANSWERS FOR THE LONGEST TIME. PLEASE HELP You are NOT allowed to use the exec, system,

c++ create a cat.cpp. I HAVE BEEN GETTING WRONG ANSWERS FOR THE LONGEST TIME. PLEASE HELP

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.

c++ create a cat.cpp that does following:

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

For example:

Assuming that filename is a text file with "c++ rules" and filename1 has "c++ is fun" $ ./cat - filename 

s <- user input

s <- automatically echoes back user input

dqewfqwef <- user input

dqewfqwef <- automaticcally echoes back user input

c++ rules <- 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.

For example:

$ ./cat filename filename1 

c++ rules <- displays contents of filename

c++ is fun <- displays contents of filename1

displays contents of both filename and filename1 and ends the cat method.

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

Step: 3

blur-text-image

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

Visual Basic6 Database Programming

Authors: John W. Fronckowiak, David J. Helda

1st Edition

0764532545, 978-0764532542

More Books

Students also viewed these Databases questions

Question

Which team solution is more likely to be pursued and why?

Answered: 1 week ago

Question

4. I can tell when team members dont mean what they say.

Answered: 1 week ago