1827963 Members
2493 Online
109973 Solutions
New Discussion

Installed images

 
lesley_4
New Member

Installed images

How can I determine if an image is installed from within a command file?

I want the connad file to take different action if a program is an installed image and different action if it is not.

ie
$ if installed_image (filename) = "Y"
$ then
$ write sys$output "Fn is installed"
$ else
$ write sys$output "Fn is not installed"
$ endif
5 REPLIES 5
Phil.Howell
Honored Contributor

Re: Installed images

see help lex f$file
something like this should do
if .not. f$file_attributes(p1,"known")
Phil
David Jones_21
Trusted Contributor

Re: Installed images

Use f$file() with the KNOWN item. One gotcha is the file specification cannot contain a version specification and has to preserve concealed devices. For example:

$ spec = "sys$system:set.exe"
$ write sys$output f$file(spec,"KNOWN")
TRUE
$ spec2 = f$parse(spec)
$ write sys$output f$file(spec2,"KNOWN")
FALSE
$ spec = "disk$avms82r1:[vms$common.sysexe]set.exe"
$ write sys$output f$file(spec,"KNOWN")
FALSE
I'm looking for marbles all day long.
lesley_4
New Member

Re: Installed images

Thanks Phil & David

Lesley
Hein van den Heuvel
Honored Contributor

Re: Installed images


Lesley, welcome to the ITRC OpenVMS Forum.

Please consider recognizing the effort of the responders and the quality of the answer by assigning 'points'. Follow the 'How to earn points' link on your left, and check the FAQ for a minute in return for 'free support, worth every penny'.

http://forums1.itrc.hp.com/service/forums/helptips.do?#28

Regards,
Hein van den Heuvel

( 0 points for this reply please )
John Gillings
Honored Contributor

Re: Installed images

> One gotcha is the file specification cannot contain a version specification and has to preserve concealed devices.

It's even more of a gotcha than that! The file specification must translate to EXACTLY the same filespec used to install the image. This is part of "known file paranoia".

General rule: DEFINE a /SYSTEM/EXEC logical name pointing to any image to be installed which doesn't reside in a system directory. Always use it to INSTALL or reference the image, and everything will work as you expect.
A crucible of informative mistakes