Path: utzoo!utgpu!water!watmath!clyde!att!pacbell!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!ucsd!ucsdhub!jack!nusdhub!rwhite From: rwhite@nusdhub.UUCP (Robert C. White Jr.) Newsgroups: comp.lang.c Subject: Re: No fork() in MSC5.0, help... Message-ID: <1112@nusdhub.UUCP> Date: 22 Jul 88 19:11:49 GMT References: <3083@emory.uucp> Organization: National University, San Diego Lines: 36 in article <3083@emory.uucp>, platt@emory.uucp (Dan Platt) says: > In article <9900005@bradley> brian@bradley.UUCP writes: >> Of course, I could do a system() with my whole command line, but this >>is not a solution because 1) there is no way to pass the environment >>in this case, 2) I would have to somehow translate my shell's syntax >>back to MS-DOS COMMAND.COM syntax, which may not be possible, and >>3) the system() function probaly will load in another copy of COMMAND.COM, >>and my shell will be cutting into avaible memory at it is. > The only way I can see you doing it is using spawnv*() with a > temporary file used to pass the information. You may need to > tolerate loaded versions of COMMAND.COM. If you are only loading > one process at a time on top of your shell, this shouldn't be to > much of a problem unless your shell is large. I think you are missing one small point here. "COMMAND.COM" is the MS-DOS shell. If you write something to replace it, you must *include* a loader of you own in the text of your shell. If you look up the dos function call which loads programs, you will find that it invokes the shell (e.g. command.com) to do the loading. If you write your own true shell, it must contain a assembly or such which will act as the loader from then on. Once you have doen this, you may simply decide that the loade will remain in low memory all the time, and never worry about loading the loader again. All this is you own choice. If you only wish to write a simple command editor/environment that is your own get out, but it is not a "MS-DOS shell" Put simply: If you write a _true_ shell, you will have the procedures to do whatever you want durring loading locally available to your shell. At that point spawn() and exec() from the Microsoft C compiler become irrevelant. Rob.