Question
C program that takes one command line argument: the fully qualified name of a folder. The program creates two children processes. The first child process
C program that takes one command line argument: the fully qualified name of a folder. The program creates two children processes. The first child process checks whether the input folder name already exists on the filesystem and communicates the outcome to the second child process via a pipe and exits. The second child process will then either create the folder if it does not exist or perform no action if the folder already exists. Upon creation of the folder, the second child process sends a confirmation message to the parent process via another pipe and then exits. The parent process then checks for the folder to be empty. If there is content in this folder, the parent process deletes all content and prints a message for the user upon successful completion and terminates. All printing, input, and reading (from filesystem or the console) should be done by system calls. You cannot use any library functions.
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