Question: Create a program that uses two command line parameters as follows ( in order ) : - Filename - Chunk size in Byte Your program
Create a program that uses two command line parameters as follows in order:
Filename
Chunk size in Byte
Your program should open the file if it is there and read the entire chunk into memory based on the chunk size requested. The content in memory will then be written to a new file starting with ie for multiple chunks due to file size, your program should generate multiple files as 'filename 'filename
Add sanity checks for your program and create a makefile.
A byte file split into kB note kB vs kiB results in files, the last one B in size.
Hint:
You will need to first reserve the memory before reading into it malloc and calloc are your friends and you should free the memory afterwards and close all resources descriptors when done.
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
