Question: use this template code #include #include #include #include #include / / ! ! ! DO NOT CHNAGE BUFSIZE #define BUFSIZE 1 0 / * size
use this template code
#include #include #include #include #include DO NOT CHNAGE BUFSIZE #define BUFSIZE size of chunk to be read #define PERM file permission for new file int concatFilesconst char name const char name const char name int infile infile outfile; ssizet nread, nwrite; char bufferBUFSIZE; if infile openname return ; if infile openname return ; if outfile openname PERM return ; Fill out this part!! main loops closeinfile; closeinfile; close outfile; return ; int mainint argc, charargv ifargc printfUsage: concatFiles file file file
; exit; int retcode; retcode concatFilesargv argv argv;
to answer this question below
points Complete a function "concatFilesconst char name const char name const char name in the attached program template "prog.c After its completion, name file will have contents obtained by concatenating the contents of namel file and name file. For example, if name file contains the following characters:
ABCDMHJWP
And, if name file contains the following characters: TUVXYZ
Then, after its execution the name file will contain characters:
ABCDMHJWPTUVXYZ
You can only make use of the following system calls in the function implementation:
a open
b read
c Iseek
d write
eclose
You have to complete the function definition in the attached "prog.c file which includes main calling dupFiledataltxt "datatxt "datal.txt file is also attached. Your function should use the buffer size of bytes in reading and writing. Please take the following requirements into account when you create the function definition:
namer file and name fle should be existent when the function is called. Otherwise, your program should exit without doing anything.
Name 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 name file already exists, your program should exit without doing anything.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
