buwyatt%brock.cdn%ubc.csnet@RELAY.CS.NET (Jamie Wyatt) (09/04/87)
I am working on a project and I wish to allow the user to spawn to the dos shell to allow him to perform DOS command then type 'EXIT' and return to my application. I
buwyatt%brock.cdn%ubc.csnet@RELAY.CS.NET (Jamie Wyatt) (09/04/87)
I am working on a project and I wish to allow the user to spawn to the dos shell to allow the use of DOS commands then when finished type 'EXIT' and return to my application. I have it working but the DOS environment is destroyed. Anything that was set before my program is called is OK but the remainder of the environment is destroyed (filled with garbage) so that no further 'sets' can be performed. This is a sample of what I did to get the shell up:
mc68020@gilsys.UUCP (Thomas J Keller) (09/09/87)
In article <9172@brl-adm.ARPA>, buwyatt%brock.cdn%ubc.csnet@RELAY.CS.NET (Jamie Wyatt) writes: > I am working on a project and I wish to allow the user to spawn > to the dos shell to allow him to perform DOS command then type > 'EXIT' and return to my application. Look, Jamie, nothing personal, but this is ** NOT A C LANGUAGE PROBLEM **! This newsgroup is for the discussion of C language issues. Your problem is quite clearly an MeSSY-DOS programming problem. I have noted an increasing number of such MeSsy-DOS programming questions appearing here. Kindly ask these questions elsewhere, thank you. -- Tom Keller VOICE : + 1 707 575 9493 UUCP : {ihnp4,ames,sun,amdahl,lll-crg,pyramid}!ptsfa!gilsys!mc68020
platt@emory.uucp (Dan Platt) (09/12/87)
In article <1125@gilsys.UUCP> mc68020@gilsys.UUCP (Thomas J Keller) writes: >In article <9172@brl-adm.ARPA>, buwyatt%brock.cdn%ubc.csnet@RELAY.CS.NET (Jamie Wyatt) writes: >> I am working on a project and I wish to allow the user to spawn >> to the dos shell... > > Look, Jamie, nothing personal, but this is ** NOT A C LANGUAGE PROBLEM **! > > This newsgroup is for the discussion of C language issues. Your problem is >quite clearly an MeSSY-DOS programming problem. I have noted an increasing >number of such MeSsy-DOS programming questions appearing here. Kindly ask >these questions elsewhere, thank you. >-- >Tom Keller >VOICE : + 1 707 575 9493 >UUCP : {ihnp4,ames,sun,amdahl,lll-crg,pyramid}!ptsfa!gilsys!mc68020 Actually, the question that Jamie asked is not messy, nor is it particularly DOS. This question has to do with the C/DOS interface. The answer is the system function call 'system("command");'. The programming technique is completely analogous to the technique used in unix (' system("sh"); '). This question is germain to C as much as any discussion of the functions are (such as printf, malloc, scanf, etc) or would you rather exclude these as not being 'strictly C'. There is a Waterloo C compiler for the IBM 370 series to operate under cms which doesn't have any unix like interfaces (no malloc even, so have fun with dynamic trees), which demonstrates that C is a very primitive language with strong structures. As far as the real power of C, it is strongly dependent on the interface the language has with the system, and most of the questions I've seen here deal with how do the functions behave (at least, this is the kind of information I've found the most interesting). Dan