From: MERC::"uunet!WKUVX1.BITNET!MacroMan" 16-JUN-1992 09:40:02.88 To: MACRO32@WKUVX1.BITNET CC: Subj: RE: Can I get the creation date/time of the image I am running? writes: > >Is it possible to determine the date and time at which a VMS executable image >was linked from inside the running program? I would like to be able to run a >program and have it display the link date/time as a version i.d. I don't seem t o >be able to find anything relevant in the manuals, although if someone could >direct me to the right place I'd be grateful. > The link date/time, along with the .IDENT version, can be found in the image header. The header for the currently executing image can be found at the address stored at CTL$GL_IMGHDRBF. The relevant code in BLISS is: image_header = .ctl$gl_imghdrbf[0]; image_info = .image_header + .image_header[ihd$w_imgidoff]; image_id = image_info[ihi$t_imgid]; image_name = image_info[ihi$t_imgnam]; ch$move(2 * %upval, image_info[ihi$q_linktime], .link_time); In MACRO, this would look something like: MOVL G^CTL$GL_IMGHDRBF,R0 ; Get header buffer address MOVL (R0),R0 ; Get header address MOVZWL IHD$W_IMGIDOFF(R0),R1 ; Get offset to IMG ID section ADDL2 R1,R0 ; R0 points to image ID MOVQ IHI$Q_LINKTIME(R0),TIME ; Move link time to my buffer The symbols are defined in $IHDDEF and $IHIDEF in SYS$LIBRARY:LIB.MLB. Hunter ------ Hunter Goatley, VMS Systems Programmer, Western Kentucky University goathunter@WKUVX1.BITNET, 502-745-5251