Question: Write a C program on Pond that create multiple files of a specific size. Details: a. Accepts 2 command line inputs (aside from the executable
Write a C program on Pond that create multiple files of a specific size. Details:
a. Accepts 2 command line inputs (aside from the executable file itself): number of files to create, size of each file (in bytes). For example run your program as ./hw4 10 20 will create 10 files of size 20 bytes each. Your program should check and report not only incorrect # of arguments, but also invalid argument values, such as zero or negative.
b. Creates that many files named after your first name (yourname0, yourname1, yourname2 ) and writes the required number of bytes to each file. One simple strategy is to write that many number of one same character since each character is one byte. The content of the files isnt important, just the size. After running your program, use ls l to see the result and verify files of correct size were created.
c. After your program is debugged, delete all files created by your program on Pond before moving to next steps. Use command rm to delete all files. For example rm crystal* will delete all files whose name starts with crystal.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
