Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started