Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 Write a C program which takes two arguments from command line: one filename and one number of items. Your program must check if

image text in transcribed

Question 1 Write a C program which takes two arguments from command line: one filename and one number of items. Your program must check if correct number of arguments are supplied and terminate if not. Your program must create three child processes in the following order: first child process creates the mentioned file and fills it with the specified number of random characters (a-z). The second child process executes "zip command to make a compressed copy of your file. The third child process must execute "Is" command to display both files. Between each child process, parent must wait for termination of former process to create the new process. Sample Run $ ./question1 chars 40000 [PARENT] Creating first process... [CHILD1] Writing 40000 random chars to chars.txt... [PARENT] Creating second process... [CHILD2] Executing zip command... adding: chars.txt (deflated 37%) [PARENT] Creating third process... [CHILD3] Executing ls command... 40000 chars.txt 25492 chars.zip [PARENT] Done

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

More Books

Students also viewed these Databases questions