next up previous index
Next: Z267 Convert File-name Up: CERNLIB Previous: Z265 Immediate Interface

Z266 Get the name of the executing module

Routine ID: Z266
Author(s): F. Carminati, J. ZollLibrary: KERNLIB, VAX only
Submitter: Submitted: 01.04.1994
Language: FortranRevised:

This routine will figure out the path-name of the executing image. On the VAX this is done with a system call, on UNIX by scanning the search path until it finds the module whose name is in argv[0].

Structure:

SUBROUTINE subprograms
User Entry Names: WHOAMI
Common Blocks: COMMON /SLATE/ ND,NE,NF,DUMMY(37)

Usage:

    CALL WHOAMI(NAME)
On exit, NAME contains the full path-name of the module.

Status and various lengths are returned in /SLATE/:

    ND = 0  if the call failed,
       > 0  the number of characters in the path-name
On the VAX:
ND =  number of characters in the path-name with .EXE;n stripped
NE =  number of characters before the semicolon,
NF =  number of characters in the complete name.
For example:
      if NAME is  DISK:[CERN]WYLBUR.EXE;4
                  _:.=+=.: 1_:.=+=.: 2_:.=+=
 
      we will get  ND=17, NE=21, NF=23.
Note: At the moment this is available only on the VAX; the code exists for UNIX but is not yet in the library.

Z267


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995