Question: please complete the function in C language files needed are below prog1.c #define BUFSIZE 10 // you need to complete this function // fd: file
please complete the function in C language
files needed are below
prog1.c
#define BUFSIZE 10
// you need to complete this function
// fd: file descriptor passed by the main function (already opened for you)
// name: string for the file name
int convertToUpper(int fd, const char* name)
{
}
int main()
{
int i, cnt, fd, nread;
off_t fileSize;
char temp[500];
fd = open("data.txt", O_RDWR);
fileSize = lseek(fd, (off_t)0, SEEK_END);
lseek(fd, (off_t)0, SEEK_SET);
cnt = convertToUpper(fd, "data.txt");
lseek(fd, (off_t)0, SEEK_SET);
nread = read(fd, temp, 500);
for(i=0; i
close(fd);
}
data.txt
Bottomless vales and boundless floods,
And chasms, and caves, and Titan woods,
With forms that no man can discover
For the tears that drip all over;
Mountains toppling evermore
Into seas without a shore;
Seas that restlessly aspire,
Surging, unto skies of fire;
Lakes that endlessly outspread
Their lone waters lone and dead,
Their still waters still and chilly
With the snows of the lolling lily.
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
