[comp.sys.amiga.programmer] current directory prompt

fwp@unccvax.uncc.edu (Rick Pasotto) (04/11/91)

Posting for a friend without net access:

 
I have a question concerning DOS and processes and the like.  A program
I have written goes thru a bunch of hooey, and eventually calls
the CurrentDir() function with a different directory than the one you
started the process in, then exits.   If you then type CD, you are in the
directory the program chose.  But, if you happen to have your
PROMPT to include the '%s' parameter (the one that says to include the
current directory in your prompt) -  the prompt doesnt change until you
do a CD.   It seems the system knows what directory you are currently
in, but hasn't bothered to tell the CLI about it.
Looking at the PROCESS structure in the include files, I see that there
is BCPL pointer that contains the lock for the current directory.   I'm
figuring all I gotta do is change this value to the lock I have gotten
on the current directory, but how do I get a hold of the current Process
structure so I can change this value?   I know that FindTask() gives you
the current task structure, but how do I get a hold of the process
structure.   Once I get a hold of the process structure, will changing the
current directory do what I want to do?
 
 Thanks in advance for your comments.
 
Jim Boyd