[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

566.0. "Change main process default to that of a subprocess?" by ARVOX::MARK (Mark Gillis, 273-3516, VRO3-3/B6) Tue Sep 29 1987 18:45

Calling all DCL Hackers:

While in my main process, I want to find out the default disk and directory of
a subprocess that I own in my job tree. I want to then change the 
main process default to that of the sub process in a command procedure.

    Pseudo DCL:

        .
        .
        .
        $ figure_out_sub_process_id:
        .
        .
        .
        $ sub_process_default = F$GETJPI(sub_process_id, "DEFAULT")
        $ SET DEF 'sub_process_default'
        .
        .
        .
Only problem is that F$GETJPI() does not have an item like this (as far as I 
have been able to determine).

Thanks,
T.RTitleUserPersonal
Name
DateLines
566.1sure, use a job table logicalBIGALO::GRAZIANO_ROBi want to fly like a BeagleWed Sep 30 1987 11:149
    have the subprocess assign a logical, say "SUB_DEFAULT", in the
    job table.. them have the main process "$set def SUB_DEFAULT:"
    
    if the subprocess is running an executable, not at dcl, and you
    created that executable, you can set the logical by 
    lib$set_logical("SUB_DEFAULT", the_default, "LNM$JOB", , )

    have fun,
    rocko
566.2 SQM::HALLYBI sell too soonMon Oct 12 1987 15:427
    Presumably you know that there is an F$ENVIRONMENT("DEFAULT").
    Together with the PID and the job logical name table you have
    all you need.
    
    Not crystal clean, but easily workable.
    
      John
566.3Further clarification of the problemARVOX::MARKMark Gillis, 273-3516, VRO3-3/B6Thu Oct 22 1987 16:1813
>While in my main process, I want to find out the default disk and directory of
>a subprocess that I own in my job tree. I want to then change the 
>main process default to that of the sub process in a command procedure.

Thanks for the feedback so far - it has been helpful.

Let me clarify the problem a bit. The sub-process whose default device and
directory I want to get is not running an image or command procedure that
I can control. It is an interactive process at the command level. Therefore
I have to get that information completely through the main process - I cannot
program the sub-process to send the information to me one way or another.

Thanks,
566.4STAR::PIPERDerrell Piper - VAX/VMS DevelopmentFri Oct 23 1987 11:076
    It sounds like you'll have to write an image that queues a special
    kernel AST to the subprocess and then sets up some magic symbols that
    you can read in your main process' command procedure.

    Somewhere, probably VMSNOTES, someone recently posted the guts of an
    image that does the QAST.
566.5SMAUG::MENDELPessimists Always Get Good News.Fri Oct 23 1987 15:435
    It seems to me that you should be able to find the default directory
    from the PCB, no?
    
    (A curious person)
    Kevin 
566.6NEWVAX::CRITZDon't shuffle my stack, I had 4 aces!Fri Oct 23 1987 20:024
    RE: .5
    
    No, since it's stored in two places, neither of which is the PCB
    (paged pool and P1 space to be exact)
566.7RE .6SMAUG::MENDELPessimists Always Get Good News.Mon Oct 26 1987 15:3211
    Oops. I know its not _in_ the PCB.
    
    I thought, though, that there should be a pointer trail from the
    PCB to a data structure with the process's default directory spec.
    
    How does a process find it's own default directory? Is it at (or
    off of) a fixed location in P1 space?
    
    (still curious)
    
    Kevin 
566.8STAR::PIPERDerrell Piper - VAX/VMS DevelopmentWed Oct 28 1987 11:237
    A process should call SYS$SETDDIR, which can return the current
    directory spec.  This service, formerly documented in the RMS Reference
    Manual is now documented in the System Service Reference Manual
    SYS-446.3 (V4.4). 

    SYS$SETDDIR most likely looks at PIO$GT_DDSTRING which is the P1
    address of the default directory string (from [SYS.LIS]SHELL.LIS).
566.9Why and why notMDVAX3::COARMy hero? Vax Headroom, of course!Thu Dec 17 1987 18:5012
    As I understand it, this functionality has not heretofore been provided
    (though muchly desired) because the SPKAST would have to call $TRNLNM
    to find the definition of SYS$DISK.  Since that may point to a logical
    name that is meaningless to another process (i.e., resides in the
    target's process-logical-name-table only), and because of the overhead
    involved (charges quite a bit of CPU time to the target, who's all
    unaware), it has been left as an exercise for the hacker.  Or so
    I was told.  Perhaps this functionality is present in the SUMR (Still
    Unannounced Major Release) to come.  I don't know; I haven't been
    watching those conferences (conferecii?)..
    
    #ken	:-)}