Question: Given the template code, copyConvert . c , fill up the marked portion so that your program is performing the following tasks: Read from input

Given the template code, copyConvert.c, fill up the marked portion so that your program is performing the following tasks:
Read from input file from the string pointed by argv[1].
Replace every occurrence of a lower-case char with that of an upper-case char.
Write the converted file contents into another file pointed by argv[2].
You are allowed to use only the system calls covered in the class (e.g., read(), write(), open(), close()). You cant use library calls such as fread(), fopen(), fwrite(), etc. If you dont follow this requirement, you will get significant penalty!!
You can compile this program as was discussed in the class:
$> gcc o copyConvert copyConvert.c
After the compilation you need to run your program with two file names as command-line arguments such as:
$>./copyConvert file1.txt file2.txt
Then your program is supposed to create another file file2.txt from the existing file file1.txt after replacing each occurrence of a lower-case character with an upper-case character.
For example, if your input file, file1.txt, contains:
GAILY bedight,
A gallant knight,
Then, the output file, file2.txt, should contain:
GAILY BEDIGHT,
A GALLANT KNIGHT,

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!