Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For this project you will create a utility that will take as its parameters two filenames. The two filenames will be an input file and
For this project you will create a utility that will take as its parameters two filenames. The two filenames will be an input file and an output file. The usage from the command line will look like this: /reverse INPUT_FILENAME OUTPUT_FILENAME When the program completes, the input file will have all of its text written in reverse to the output file. The following criteria should help you in creating this utility: You will need a file_utils.h file with your function signatures, include guards, etc. It will include two functions int read_file( char* filename, char *buffer ); int write_file( char* filename, char *buffer, int size) DO NOT CHANGE THESE FUNCTION SIGNATURES IN ANY WAY! You will need a file_utils.c file with your code implemented. You will need a reverse.c file with code that accepts command arguments, includes a main function, and calls the functions from the included files. C doesn't have exceptions so you must create exception handling on your own. You must perform checks to make sure that memory allocation calls complete correctly and that file read/write operations complete correctly. Use fprintf( stderr, "ERROR MESSAGE" to print error messages. This will send them to the error stream instead of the standard output stream. For this project you will create a utility that will take as its parameters two filenames. The two filenames will be an input file and an output file. The usage from the command line will look like this: /reverse INPUT_FILENAME OUTPUT_FILENAME When the program completes, the input file will have all of its text written in reverse to the output file. The following criteria should help you in creating this utility: You will need a file_utils.h file with your function signatures, include guards, etc. It will include two functions int read_file( char* filename, char *buffer ); int write_file( char* filename, char *buffer, int size) DO NOT CHANGE THESE FUNCTION SIGNATURES IN ANY WAY! You will need a file_utils.c file with your code implemented. You will need a reverse.c file with code that accepts command arguments, includes a main function, and calls the functions from the included files. C doesn't have exceptions so you must create exception handling on your own. You must perform checks to make sure that memory allocation calls complete correctly and that file read/write operations complete correctly. Use fprintf( stderr, "ERROR MESSAGE" to print error messages. This will send them to the error stream instead of the standard output stream
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started