🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #8430

Re: Access to the command path?

#8430
From: SLMYQ
Date: Wed, 06 Apr 1988 08:01
35 lines
2140 bytes
>> Where can I find the current command path for a CLI instantiation?
>> It must be a list of locks somewhere. I just didn't find the root.
>> Any hints, ideas?
>
>From the AmigaMail issue with the 1.2 updates in it:
>
>The path list is held as a BPTR in the CommandDir member of the
>CommandLineInterface structure. Each element of the path list consists of:
>    BPTR NextPath (BPTR to next list entry)
>    BPTR PathLock (a lock on the directory)
>
>The CommandLineInterface structure for a dos process can be found via the
>BPTR pr_CLI element in its Process structure.

Hmmm.  I never knew it was there, but I think I have an easier way to find
the path.  Just use ParentDir() to find parent locks, and Examine() to find
out their filenames.  You build your path string backwards in memory.  I've
got a routine to do this if you're interested, and you don't have to mess
with a single BPTR.

Also, yet a simpler way is to look at the SetName BSTR in the CLI structure.
Unfortunately, if you use my CD program that puts the path in the title bar -
I didn't know about this when I made it, so it doesn't update it.  That's
why if you do something like "Copy #?.c to ram:" using my CD and the BCPL
Copy command, it'll say things like "DF0:Foo.c" and "DF0:Bar.c", because
my CD program doesn't update the path string.  Maybe in the next version.
Anyway, basically, if you use this string, you depend on the CD program you're
using to update the SetName.

                                Bryan

        Bryan Ford                    //// A computer does what \\\\
Snail:  1790 East 1400 North         //// you tell it to do, not \\\\
        Logan, UT 84321          \\\X///  what you want it to do. \\\X///
Email:  SLMYQ@USU.BITNET          \XXX/ Murphy's Law Calendar 1986 \XXX/
Technical Details
Message-ID: <8804060829.AA14283@jade.berkeley.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!bellcore!faline!thumper!ulysses!ucbvax!USU.BITNET!SLMYQ

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!bellcore!faline!thumper!ulysses!ucbvax!USU.BITNET!SLMYQ
From: SLMYQ@USU.BITNET
Newsgroups: comp.sys.amiga.tech
Subject: Re: Access to the command path?
Message-ID: <8804060829.AA14283@jade.berkeley.edu>
Date: 6 Apr 88 08:01:00 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Lines: 35