Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ create a cat.cpp. You are NOT allowed to use the exec, system, popen, and pclose system calls or functions in your implementation. You are

c++ create a cat.cpp.

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"

$ ./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.

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

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions