Question: Write a project in C (Linux) which will fork off versions of itself to do some file processing. It will start by using some command
Write a project in C (Linux) which will fork off versions of itself to do some file processing.
It will start by using some command line arguments. You must implement at least the following command line arguments using getopt:
-a
-b inputFile
-c outputFile
-a option will display all legal command line options
If input and output filenames are not specified, the defaults should be intputFile.dat and outputFile.dat
Once you have parsed the command line arguments and validated them, then you should attempt to open the input file.
The input file will have 1 2 3 4 5 and the output file will write the intput file in reverse 5 4 3 2 1
The main process (parent) will read the first line of the file. Once it has read that line, it will write to the output file in reverse:
Example:
inputFile.dat will be 1 2 3 4 5
outputFile.dat will be 5 4 3 2 1
The format for error messages should be:
logParse: Error! Detailed error message where logParse is actually the name of the executable (argv[0]) that you are trying to execute. These error messages should be sent to stderr using perror.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
