Question: USING UNIX SYSTEM CALLS IN C Reverse a file and write its data either to the screen or to another file (lastnameRV.c): Write a C
USING UNIX SYSTEM CALLS IN C

Reverse a file and write its data either to the screen or to another file (lastnameRV.c): Write a C program (call it lastnameRV) that will reverse the content of a file and prints either to the screen or into a file ( -f flag). The command: Takes either one or two file names (source file sFile, and destination file dFile) as input Takes the following flag combinations: -f: if the dFile exists, its content is overwritten with the reversed content of sFile The commands below show the results given the following files: file1 contains: This is the content of file 1." $lastnameRv file1 .1 elif fo tnetnoc eht si siht. Will be displayed on the screen. $lastnameRV -f filel file2 file2 content will be: .1 elif fo tnetnoc eht si siht. Other input combinations should give the user hint messages of how to use the command. [-] reverse -f
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
