Re: repost

Scott Raney (raney@metacard.com)
Fri, 28 Feb 1997 11:40:27 -0700 (MST)

On Fri, 28 Feb 1997, Simon Lord wrote:

> I'd like to repost a question I sent yesterday in the fear that it may
> not have been read by anyone. I'd also like to ask everyone to bear with
> me, I know I've been asking alot of silly questions lately. But give me
> just one more week and I'll have all the information I need to complete
> a much needed software tool for my department.
>
> The question was, how can I send a process to a shell and not have
> MetaCard wait for it to finish? This particular shell process (compiler)
> takes over 6 hours to complete, I'd really rather not stare at a "watch"
> for six hours.
>
> If you're wondering why we can't simply run the process in a shell
> manually and then continue in MetaCard. Then my responce would be that
> at CAE that's exactly what we do but this tool has to be completely
> idiot proof for the end user, our customer.
>
> We build flight Simulators, and unfortunately we also write our own
> software which is less than friendly. Running it on a UNIX workstation
> is hell for us in production, when it's passed onto the customer it
> becomes an absolutley daunting feature that is next to impossible to
> use.
>
> So, my job is to put a friendly face on our "command line" set of tools
> and run stuff in the background, it wasn't until I ran into this 6 hour
> process that "put shell()" became a problem for me.

You want the "open process" command. It doesn't block, which means
your stack can go off and do other things while the process is
running. The other difference is that "open process" doesn't run a
shell, which means you can't put things that only shells understand on
the command line (e.g., you can't use a | to connect multiple
commands, or redirect output to a file with the > character). Use
open process to run a shell script if you need to do one of these
things.

If you don't need the output from the process, use "open process x for
neither", which will allow the process to clean up for itself
automatically. If you need the processes output, use "open process x
for read" and then periodically read from the process. Note that you
need to do a "close process x" if you open it for read. The
openProcesses() function will tell you whether your subprocess has
finished running or not.
Scott

> --
> [---------------------------] Simon Lord
> [Important letters that.....] Database Engineer, CAE Electronics
> [contain no errors will.....] tel: (514) 341-2000 x3861
> [develop errors in the mail.] fax: (514) 340-5496
> [---------------------------] email: simonl@cae.ca
>

***************************************************************
Scott Raney raney@metacard.com http://www.metacard.com
Any sufficiently advanced technology
is virtually indistinguishable from magic -- Clark's law