Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

// 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

image text in transcribedimage text in transcribed// 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

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

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions