3) -diff_files /* DoDiff()
Your task:
1. Do argument validation
- file name length is no more than 1023
- If a command-line argument is too long,
print out "Error: arugment is too long" to stderr
2. Open the two files
- The name of files are given by two parameters
- If you fail to open either file, print out error messsage
- Error message: "Error: failed to open file [filename]\n"
- Error message should be printed out to stderr
3. Read the each line from each file
- If you encounter a line larger than 1023 bytes,
print out "Error: input line [filename] is too long"
- Error message should be printed out to stderr
4. Compare the two files (file1, file2) line by line
5. Print out any different line with the following format
file1@linenumber:file1's line
file2@linenumber:file2's line
6. If one of the files ends earlier than the other, print out an
error message "Error: [filename] ends early at line XX", where
XX is the final line number of [filename].
NOTE: If there is any problem, return FALSE; if not, return TRUE */
4. Compare the two files (file1, file2) line by line
5. Print out any different line with the following format
file1@linenumber:file1's line
file2@linenumber:file2's line
6. If one of the files ends earlier than the other, print out an
error message "Error: [filename] ends early at line XX", where
XX is the final line number of [filename].
NOTE: If there is any problem, return FALSE; if not, return TRUE */