Question: ( 5 0 points ) Complete a function concatFiles ( const char * name 1 , const char * name 2 , const char *

(50 points) Complete a function "concatFiles(const char* name1, const char* name2, const char* name3)" in the attached program template "prog.c" After its completion, name3 file will have contents obtained by concatenating the contents of namel file and name2 file. For example, if namel file contains the following 9 characters:
ABCDMHJWP
And, if name2 file contains the following 6 characters: TUVXYZ
Then, after its execution the name2 file will contain 15 characters:
ABCDMHJWPTUVXYZ
You can only make use of the following system calls in the function implementation:
a. open()
b. read()
c. Iseek()
d. write()
e.close()
You have to complete the function definition in the attached "prog.c" file which includes main() calling dupFile("datal.txt", "data2.txt"). "datal.txt" file is also attached. Your function should use the buffer size of 10 bytes in reading and writing. Please take the following requirements into account when you create the function definition:
namer file and name2 fle should be existent when the function is called. Otherwise, your program should exit without doing anything.
Name3 file should not be existent when you call the function. It needs to be created as an empty file and the contents need to be filled up. If name3 file already exists, your program should exit without doing anything.
( 5 0 points ) Complete a function "concatFiles (

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!