Question: Please read carefully provided screenshots as well Points Possible: 100 Task 1 (50 points) Implement a program to display a file's contents. It should be

Please read carefully provided screenshots as well  Please read carefully provided screenshots as well Points Possible: 100 Task

Points Possible: 100 Task 1 (50 points) Implement a program to display a file's contents. It should be similar to the UNIX cat command when given a single file. Name your command show. It should have the following syntax: s /show fileName The above program displays the contents of the file named fileName. Each system call must have error checking, and print an error message if it occurs. You must use open O, read O, write) and close) system calls. 10 points each. Task 2 (50 points) Modify the above program to implement a program called body similar to UNIX commands head or tail. It should print from the mh line to the nth line of the given file. It should have the following syntax: s /body m n fileName The above program displays the contents of the file naned 11lelamo, from line m to line n. Hint: read file character by character and check for n Each system call must have error checking, and priut an error message if it occurs. You must use open(), readO, writeO, and coeO system calis to points each Using fopen), scanf), printfO, feloseO functions from standard library instead of system calls will result in 0 grade for both tasks

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!