koren@hpfelg.HP.COM (Steve Koren) (10/25/89)
I have a rather desparate plea... I am very nearly done with a large programming project on the Amiga which is to be freely distributable when I am done with it. It is currently around 12000 sources lines not counting comments and some libraries I developed earlier. I have it all working, and mostly debugged, but I am missing just one little tiny thing. I'm sure *someone* knows how to do it. I need a way to execute programs that meets the following criteria: 1) I must be able to examine the return code from the command 2) I must be able to pass command line parameters to the command 3) I must be able to redirect standard i/o 4) The command must run interactively; that is, if I run something like Format, format must talk to the keyboard. Also, the command that is run must listen to the break key normally 5) The command, if it in turn executes another command, must properly look at the AmigaDos path. Also, I very highly want the following: 6> A way to set the stack size and task priority 7) A method that won't crash on BCPL programs (as forkv() does - it also crashes on around 10% of other, non BCPL code) 8) A way to run the command in the background if I wish Every method I know of violates at least one of 1..5, and possibly 6..8. a) Execute() violates 1, maybe 4, and 6 and 8 b) forkv() violates 7, maybe 4, and 5 c) Loadseg()... violates 1, 2, maybe 3 and a few others d) system() violates 3, 6, 7, 8, and maybe a few others It seems to me that there *must* be an easy way to do this. After all, the AmigaDos CLI does it, no? It seems like a most basic thing for an operating system to do. forkv() comes close, but it is useless to me. I can sort of get around it crashing on BCPL code, but it also crashes on around 10% of all other software I have. That alone makes it unusable if I want to develop a robust piece of software. I would be *very* greatful to anyone who can help. I need a solution that will work with Lattice 5.02 or later, so even if you can just point me to some public domain code I can examine that does this under Lattice, that would be great. I absolutely need this for my project, and the results will be available to the Amiga community. thanks, steve (koren@hpfela.HP.COM)
Sullivan@cup.portal.com (sullivan - segall) (11/02/89)
> >I need a way to execute programs that meets the following criteria: > > 1) I must be able to examine the return code from the command > 2) I must be able to pass command line parameters to the command > 3) I must be able to redirect standard i/o > 4) The command must run interactively; that is, if I run something > like Format, format must talk to the keyboard. Also, the command > that is run must listen to the break key normally > 5) The command, if it in turn executes another command, must properly > look at the AmigaDos path. > >Also, I very highly want the following: > > 6> A way to set the stack size and task priority > 7) A method that won't crash on BCPL programs (as forkv() does - it > also crashes on around 10% of other, non BCPL code) > > 8) A way to run the command in the background if I wish > The easiest way I can think of is by using ARexx. (To be distributed with 1.4) If that isn't acceptable, Bill Hawes should be able to steer you in the right direction. -ss
mlelstv@immd4.informatik.uni-erlangen.de (Michael van Elst ) (11/20/89)
koren@hpfelg.HP.COM (Steve Koren) writes: >I need a way to execute programs that meets the following criteria: > 1) I must be able to examine the return code from the command > 2) I must be able to pass command line parameters to the command > 3) I must be able to redirect standard i/o > 4) The command must run interactively; > 5) The command, if it in turn executes another command, must properly > look at the AmigaDos path. On some early fish-disk there was a 'make'-program that uses the following: It spawns a process that Execute()s a program. The make program itself talks to the spawned process as it's console handler and writes commands to the cli. I know it had a possibility to look at the program's return code. Michael van Elst E-mail: UUCP: ...uunet!unido!fauern!immd4!mlelstv