A program is written in C (NOT C++) that needs to accept command line arguments (see below)
Question:
A program is written in C (NOT C++) that needs to accept command line arguments (see below) should reverse the order of bytes read, and output the bytes in reverse order. To make this program more manageable, bytes should be processed in blocks of less than 1k characters (block size is a parameter and can be changed by user command-line argument). For example, if the block size is 4 and the data is “abcdefghijkl”, the blocks to be reversed would be “abcd”, “efgh”, “ijkl”, and output should be “dcbahgfelkji”.
The program should process the following optional command-line arguments (user's option - required for program):
-i ...for the input file name (default: stdin)
-o ...for the output file name (default: stdout)
-b ...for the number of characters in a block to reverse (default: 10)
REQUIREMENT: Use only system calls for all input and output operations (write, read, open, close, etc.), including any error messages that may be output (sent to stderr). The data should be from either a file or stdin and the output should be to either a file or stdout.