Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C program that uses two processes (not threads) to sort the regular files in a directory and the sub-directories based on file sizes.

Write a C program that uses two processes (not threads) to sort the regular files in a directory and the sub-directories based on file sizes. The program spawns one process (i.e., child process) to scan the directory and the sub-directories for regular files. When the (child) process finds a regular file, it obtains the size, and sends the size and the pathname of the file to the parent process through a FIFO (named pipe). The parent process sorts (in ascending order) and organizes the size and pathname information. When the child process finishes scanning, it notifies the parent process, and the parent process prints out the sizes and pathnames of the files. name the file 003_1.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

XML Data Management Native XML And XML Enabled Database Systems

Authors: Akmal Chaudhri, Awais Rashid, Roberto Zicari, John Fuller

1st Edition

0201844524, 978-0201844528

More Books

Students also viewed these Databases questions