Question: // please leave comments in code.so i can learn. above program is copy.c Task 2 (25 points) Write a program to split a file specifiled

// please leave comments in code.so i can learn. above program iscopy.c Task 2 (25 points) Write a program to split a file// please leave comments in code.so i can learn. above program is copy.c

Task 2 (25 points) Write a program to split a file specifiled from the command line argument into multiple files of filenames using sprintfO. For example: o, .1, .2, .3 to the original filename as new files' name. You can generate char *filename argv [1]; char name [256]; int i-0 sprintf (name , "%s"%d", filename, i) You can start with copy.c , but don't read just one single byte at a time. Name your source file split.c. Your program should work like this. hb117@uxb4:~$ gcc -W split.c -o split hb117@uxb4:~$ ./split foo foo.0 foo.1 foo.2 foo.3 foo.4 hb117@uxb4:~ ls -]1 total 8 1 hb117 faculty 41787 Nov 10 10:53 foo 1 hb117 faculty 10000 Nov 10 10:54 foo.0 1 hb117 faculty 10000 Nov 10 10:54 foo.1 1 hb117 faculty 10000 Nov 10 10:54 foo.2 1 hb117 faculty 10000 Nov 10 10:54 foo.3 1 hb117 faculty 1787 Nov 10 10:54 foo.4 8952 Nov 10 10:54 split rwx--x--x 1 hb117 faculty -rw1 hb117 faculty 680 Nov 10 10:54 split.c

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!