Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Complete a function convertToUpper (const char* name) to convert every lower case letter in the file into upper case letters. You need to make

image text in transcribed
image text in transcribed
image text in transcribed
1. Complete a function "convertToUpper (const char* name)" to convert every lower case letter in the file into upper case letters. You need to make use of the following system calls in the function implementation: a. open() b. read() c. lseek() d.write() e. close() You have to complete the function definition in the attached "prog.c" file which includes main() calling covert Toupper("data.txt"). "data.txt" file is also attached. Your function should use the buffer size of 10 bytes in reading and writing. If you use the other buffer sizes, you will not get the full credit. 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. #define BUFSIZE 10 Il 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 convert toupper(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); Iseek(fd, (off_t)0, SEEK_SET); cnt = converttoupper(fd, "data.txt"); 1seek (fd, (off_t)0, SEEK_SET); nread read (fd, temp, 500); for(i=0; i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

AWS Certified Database Study Guide Specialty DBS-C01 Exam

Authors: Matheus Arrais, Rene Martinez Bravet, Leonardo Ciccone, Angie Nobre Cocharero, Erika Kurauchi, Hugo Rozestraten

1st Edition

1119778956, 978-1119778950

More Books

Students also viewed these Databases questions

Question

What online recruitment methods are available?

Answered: 1 week ago