Path: utzoo!attcan!uunet!sugar!peter
From: peter@sugar.UUCP (Peter da Silva)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Launching new Tasks in C
Keywords: BBS, IPC, tasks, processes
Message-ID: <2309@sugar.UUCP>
Date: 15 Jul 88 10:59:41 GMT
References:  <2148@cadovax.UUCP>
Organization: Sugar Land UNIX - Houston, TX
Lines: 36

In article <2148@cadovax.UUCP>, keithd@cadovax.UUCP writes:
> The problem with LoadSeg though, is if "module" itself want's to open files
> relative to the directory it is in, unless you can feed to the new
> CreateProc()'ed process your current directory, it won't work.  I haven't
> yet checked to see if you can feed a created process it's current directory.

If you send the created process a standard workbench startup message, it will
get its current directory from there (assuming it's been set up right). This
means you have to hang around until the process dies (see my "click" sample
program, published in comp.sources.amiga, or I can send you a copy). There is
a way around this, though: write a daemon that just opens up a named port (say,
"WBCleanup"), and cleans up WBStartup messages sent to this port (there is
enough info in (struct WBStartup) to do this... again, see "click"). Supply
this port as the reply port of the WBStartup message. The daemon will happily
gobble the messages up and leave you free to exit.

You *do* need to be able to run the daemon, but it doesn't have to have any
standard startup code, since it never exits. So you just look for your named
port. If it's not there, LoadSeg and CreateProc the daemon and sleep a little.
Then look for the port again.

> If anyone can think of another method of meeting the 1-7 criteria
> above, I'd be glad to hear it.

See above.

> BTW, this also touches on a reason I have a big problem using anybodies
> *.library for anything useful, as novices don't have the foggiest notion on 
> how to install them.  An auto-install program has the problem that the 
> vanilla workbench is too full, requiring something to be deleted.

It'd be nice if you could specify a complete path to OpenLibrary. Can you?
-- 
-- `-_-' Peter (have you hugged your wolf today?) da Silva.
--   U   Mail to ...!uunet!sugar!peter, flames to alt.dev.null.
-- "Running OS/2 on a '386 is like pulling your camper with an Indy car"