[comp.sys.amiga.programmer] CLI path

chris@genly.UUCP (Chris Hind Genly) (01/24/91)

How does a new CLI inherit its path?

Here's what I found by experimenting.  It appears a script can modify the
path for the CLI executing it, other CLIs are not affected.  If you start a
new CLI from an existing CLI, the new CLI appears to inherit the existing
CLI's path.  It also appears that CLIs started from POPCLI aren't getting the
path that was set in s:startup-sequence.  CLIs started by the workbench do
get the path that was set in s:startup-sequence.

POPCLI is a utility supplied with the lattice C compiler that will blank the
screen and run a specified command when L-ESC is pressed.


       *                        *                        *
                                                            \|/
               *           _______                         --O--
                      ____/ KC1VP \____        *            /|\
 *             ______/  (203) 389-8680 \______
        ______/   Eggplant Software Tools     \________
 ______/  95 Fountain Terr., New Haven, CT, USA, 06515 \_______
/ Chris Hind Genly    chris@genly.uucp   uunet!hsi!genly!chris \
----------------------------------------------------------------

andy@cbmvax.commodore.com (Andy Finkel) (01/26/91)

In article <chris.8104@genly.UUCP> chris@genly.UUCP (Chris Hind Genly) writes:
>How does a new CLI inherit its path?
>

CLI's inherit their path from their parent.  If you are in a CLI,
and do a newcli, the child CLI will have a copy of the parents.

Simple, right ?

Then there's workbench.  When Workbench fires up via LoadWB, it snapshots
the paths in effect in that shell.

This is the paths that get copied when starting a shell from workbench, ie
from the CLI icon, or from tools like PopCLI.

			andy
-- 
andy finkel		{uunet|rutgers|amiga}!cbmvax!andy
Commodore-Amiga, Inc.

"God was able to create the world in only seven days because there
 was no installed base to consider."

Any expressed opinions are mine; but feel free to share.
I disclaim all responsibilities, all shapes, all sizes, all colors.

Jay@deepthot.UUCP (Jay Denebeim) (01/31/91)

In article <18122@cbmvax.commodore.com> andy@cbmvax.commodore.com (Andy Finkel) writes:
>Then there's workbench.  When Workbench fires up via LoadWB, it snapshots
>the paths in effect in that shell.
>
>This is the paths that get copied when starting a shell from workbench, ie
>from the CLI icon, or from tools like PopCLI.
>
Actually, I think the path PopCLI gets is the one that was in effect
when PopCLI was run, not the LoadWB one.  Makes sense, each process
inherits its parent's attributes.  Generally this is the same thing
of course because startup sequences would have a bunch of path
assignments etc, then the background processes such as PopCLI and
LoadWB get fired off.

>                       andy
>--
>andy finkel            {uunet|rutgers|amiga}!cbmvax!andy
>Commodore-Amiga, Inc.
>
>"God was able to create the world in only seven days because there
> was no installed base to consider."
  ^- love that quote.
>
>Any expressed opinions are mine; but feel free to share.
>I disclaim all responsibilities, all shapes, all sizes, all colors.

--

 |_o_o|\\
 |. o.| || The           Jay Denebeim
 | .  | ||  Software
 | o  | ||   Distillery
 |    |//                         Address: mcnc!wolves!deepthot
 ======          BBS:(919)-460-7430      VOICE:(919)-460-6934

chris@genly.UUCP (Chris Hind Genly) (02/02/91)

>In article <chris.8104@genly.UUCP> chris@genly.UUCP (Chris Hind Genly) writes:
>How does a new CLI inherit its path?

In article <18122@cbmvax.commodore.com> andy@cbmvax.commodore.com (Andy Finkel) writes:
>CLI's inherit their path from their parent.  If you are in a CLI,
>and do a newcli, the child CLI will have a copy of the parents.
>
>Simple, right ?
>
>andy finkel		{uunet|rutgers|amiga}!cbmvax!andy
>Commodore-Amiga, Inc.

Thanks for the reply.  But I was interested in the mechanism by which the
inheritance takes place.  How can a program I write discover what the path
is.  How can a program I write pass a new path onto a CLI it starts up?


       *                        *                        *
                                                            \|/
               *           _______                         --O--
                      ____/ KC1VP \____        *            /|\
 *             ______/  (203) 389-8680 \______
        ______/   Eggplant Software Tools     \________
 ______/  95 Fountain Terr., New Haven, CT, USA, 06515 \_______
/ Chris Hind Genly    chris@genly.uucp   uunet!hsi!genly!chris \
----------------------------------------------------------------

andy@cbmvax.commodore.com (Andy Finkel) (02/06/91)

In article <chris.1073@genly.UUCP> chris@genly.UUCP (Chris Hind Genly) writes:
>Thanks for the reply.  But I was interested in the mechanism by which the
>inheritance takes place.  How can a program I write discover what the path
>is.  How can a program I write pass a new path onto a CLI it starts up?

DOS (or under 1.3 the Shell)
copies the path list for the new CLI process, if it was started from a 
CLI process.

The path list is hanging off your CLI process structure, and is basically
a lined list of Locks.

		andy
-- 
andy finkel		{uunet|rutgers|amiga}!cbmvax!andy
Commodore-Amiga, Inc.

"God was able to create the world in only seven days because there
 was no installed base to consider."

Any expressed opinions are mine; but feel free to share.
I disclaim all responsibilities, all shapes, all sizes, all colors.