Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you help me with this project? Use JAVA. Please send me original code not from somewhere else or AI Your code should be in

Can you help me with this project? Use JAVA. Please send me original code not from somewhere else or AI
Your code should be in C, C++ or Java. In this project, you will use ordinary pipes to implement an inter-process communication scheme for message passing between processes. Assume there are three directories, d0, d1 and d2 inside your home directory. Initially, directory d0 has four short text files, named f1, f2, f3, and f4. Directories d1 and d2 are initially empty. You have to use a parent process that forks two children processes.
The parent sends a message using one pipe to the first child. In that message, the parent sends the names of the first two files, namely f1 and f2. Similarly, the parent sends a message to the second child, using the another pipe, containing the names of the other two files, namely f3 and f4.
On receiving the message from the parent, the first child creates empty files with the names contained in the message, i.e., f1 and f2 in directory d1.
Similarly, on receiving the message from the parent, the second child creates empty files with the names contained in the message, i.e., f3 and f4 in directory d2.
The parent process will send to the first child process the contents of files f1 and f2. The first child process should store in its copies of f1 and f2(in directory d1) the corresponding contents of the files.
Similarly, the parent process will send to the second child process the contents of files f3 and f4. The second child process should store in its copies of f3 and f4(in directory d2) the corresponding contents of the files. After these steps, the directories d1 and d2 together should have copies of the four files in directory d0. In your code you should not make any assumption about the size of files.
Submission Information
The submission should be through eLearning in the form of an archive consisting of:
1. File(s) containing the source code.
2. The makefile or any other script/instructions to compile the files and produce the execuable code.
3. The directories and files you used to test the execution of your code.
Your source code must have the following, otherwise, you will lose points:
1. Proper comments indicating what is being done
2. Error checking for all function and system calls

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

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions

Question

List and explain the five theories of social responsibility.

Answered: 1 week ago

Question

a. Describe the encounter. What made it intercultural?

Answered: 1 week ago