Question: Objectives To practice creating, managing, and terminating processes using system calls in C . To manipulate files and directories with system calls. To demonstrate error
Objectives
To practice creating, managing, and terminating processes using system calls in C
To manipulate files and directories with system calls.
To demonstrate error handling in systemlevel programming.
Description
In this homework, you will implement a program that performs file manipulation and
manages multiple child processes to perform tasks on files in a given directory. The program
will:
Accept a directory as a commandline argument.
For each file in the directory, create a child process that prints the file name, its size,
and the number of words in the file.
Ensure the parent process waits for all child processes to complete before exiting.
Implement basic error handling: check for invalid directories, failed process creation,
and inaccessible files.
Detailed Requirements:
Commandline Arguments:
o The program should accept one commandline argument, which is the
directory name.
o If no argument is provided, the program should print an error message and
exit.
o If the directory is invalid or doesn't exist, print an error message and exit.
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
