Change directory command, Computer Engineering

Your shell must accept a change directory command. This will be in the form: cd path  where cd is the change directory command and the path is what you will change the directory to. As you will be parsing all commands from the user, this should be broken into two char* elements. You can simply call chdir() from unistd.h and pass the path string. Be sure to check if the command worked properly. This can be done by checking the return value of the function. If the function results in an error, you must print an error message. Once again this can be done by calling perror(). Finally, regardless of if the command was successful or not, the prompt should be printed on a new line.

Posted Date: 4/3/2013 2:56:25 AM | Location : United States







Related Discussions:- Change directory command, Assignment Help, Ask Question on Change directory command, Get Answer, Expert's Help, Change directory command Discussions

Write discussion on Change directory command
Your posts are moderated
Related Questions
What is a client in SAP terminology? A S/W component that uses the service (offered by a s/w component) is known as a Client.  At the similar time these clients may also be ser

What is write-back or copy-back protocol? For a write operation using this protocol during write-hit: the method is to update only the cache and to mark it as updated with an a

What is data hazard? Any condition that causes the pipeline to stall is known as a hazard. A data hazard is any condition in which either the source or destination operands of

What is a recursively enumerable language?            The languages that is accepted by TM is said to be recursively enumerable (r. e) languages.  Enumerable means that the stri

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

#question.constructors and destructors

Q. Diffrence between CD-R vs CD RW? A CD-R disc looks same as a CD. Though all pressed CDs are silver, CD-R discs are gold or silver on their label side and a deep cyan or gree

Q. Process of World Wide Web? When you type a URL in a web browser, this is what happens: 1. If URL contains a domain name, browser first connects to a domain name server an

A phonetic password generator picks two segments randomly for each six letter password. form is CVC. what is the total password population? 1> what is the total password population

And-Introduction: In generally English says that "if we know that a lot of things are true, so we know that the conjunction of all of them is true", then we can introduce conj