Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Type this in python In this assignment you will implement the RUN functionality of your command interpreter . Your RUN command takes one argument. The

Type this in python

In this assignment you will implement the RUN functionality of your command interpreter.

Your RUN command takes one argument. The executable file specified by the argument should be run and when finished, the prompt displayed. The syntax is:

RUN executable-file

The algorithm for RUN would be as follows.

Define a parent function in which you:

Fork a child process.

Block the parent process to wait till child process ends

If child process is created successfully, call a child function that implements the child process

Define a child function from which you execute the executable program

This will require the following library functions (in Python on UNIX)

os.fork( ) creates a child process and returns the PID of the child process to the parent. Child PID is 0.

subprocess.call(path/executableProgram) executes a program in the current process

os.waitpid(pid,0) causes the parent to block until the child finishes

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_2

Step: 3

blur-text-image_3

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

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions

Question

List the major prohibitions of the Canadian Human Rights Act .

Answered: 1 week ago

Question

1. Signs and symbols of the map Briefly by box ?

Answered: 1 week ago

Question

Types of physical Maps?

Answered: 1 week ago

Question

Explain Intermediate term financing in detail.

Answered: 1 week ago