[comp.os.vms] Finding the *entire* filespec an image was activated with.

IJAH400@INDYVAX.BITNET (03/02/88)

Hello, all.

I'm trying to find the entire file specification that an image was
activated with.  If I was writing in C it would be no problem, I'd just
look at argv[0].  Unfortunately, this is for a professor who insists on
doing it FORTRAN.  Getting the IMAGNAME item from SYS$GETJPI does me no
good, it only returns the name, not the device and directory.  Neither
does LIB$GET_FOREIGN, it returns everything AFTER what I am looking
for.  Finally, getting the value of $LINE using CLI$GET_VALUE also
loses, it just shows me what the user typed, which may not be what I
want (i.e., suppose the user has SYS$SYSTEM defined as search list, and
the program (sorry, image) was run out of something near the bottom of
the list.  All I can tell from the spec at the beginning of the line
from CLI$GET_VALUE (if the image was invoked using a foreign command,
for example) was that the device name was not specified (i.e., was
SYS$SYSTEM).  This was real simple to do under TOPS-20, you could just
look at what file a page (that you knew was still mapped to the EXE
file) was mapped from.  There must be a simple way to do it under VMS,
since the VAXC runtime support evidently knows how...

                        Thanks in advance...

--------------------------------------------------------------------------------
James A. Harvey, Analyst/Programmer                     Phone:  (317)274-0747
Indiana University - Purdue University at Indianapolis
E. & T. 1023, 799 W. Michigan Street
Indianapolis, IN  46220                                 ijah400@indyvax.bitnet

    Blessed are They who keep Messy Offices, for only They shall know the
    Joy of Finding That which was thought to be Irretrievably Lost.
            - Found on Prof. Nick Kira's office door.

rrk@byuvax.bitnet (03/08/88)

I have never seen GETJPI return anything but the entire filespec of an image.
It doesn't give back exactly what the user typed, but it gives back unique
file identification that can be used to activate the image.