Operating System - OpenVMS
Showing results for 
Search instead for 
Did you mean: 

'dir' on logicals for concealed devices

Go to solution
Occasional Visitor

'dir' on logicals for concealed devices


We have a few logicals defined as concealed devices and we are seeing some differences when doing identical 'dir' commands on a Alpha w. OpenVMS 8.2 vs Itaninum w. OpenVMS 8.3-1H1 on identically defined logicals.

The 'dir' command is entered directly for the logical i.e. without specifying any default. E.g.

$ dir local_root

where 'local_root' is defined as

"LOCAL_ROOT" [super] = "disk$mylabel:[dir1.]" [concealed] (LNM$PROCESS_TABLE)

On Alpha (8.2) each object is listed exactly once but on the Itanium (8.3-1H1) each object is listed twice.

By adding the default (subdir) when entering the command i.e. 'dir local_root:[dir2]' each object is listed exactly once on both platforms.

I dont know if the syntax we're using is supported, but it's apparently become a habit both no the command line and in dcl-scripts.

- Ingvaldur
Jur van der Burg
Respected Contributor

Re: 'dir' on logicals for concealed devices

Concealed logical names should point to a device. Pointing them to another logical name is unsupported.

Occasional Visitor

Re: 'dir' on logicals for concealed devices

Thanks for reply but redefining the logical to point to a device gave the same results.

The local_root is now defined like:
"LOCAL_ROOT" [super] = "mynodename$dkb21:[dir1.]" [concealed] (LNM$PROCESS_TABLE)

Having default set to 'test' and listing the contents of local_root:[test] without specifying 'test' gives the following results:

$ dir /size/date/prot local_root

Directory local_root:[TEST]

ccc.c;1 0.50KB 5-JAN-2010 13:20:18.43 (RE,RWED,RWED,RE)
ccc.c;1 0.50KB 5-JAN-2010 13:20:18.43 (RE,RWED,RWED,RE)

Total of 2 files, 1KB

It works as expected when specifying default/subdir when listing contents from above like:

$ dir /size/date/prot local_root:[test]


ccc.c;1 0.50KB 5-JAN-2010 13:20:18.43 (RE,RWED,RWED,RE)

Total of 1 file, 0.50KB

(We have a lot of concealed logicals that point to other logicals and it just works. But we're going to change that so they point to devices instead. Thank you for pointing that out.)

- Ingi
Robert Gezelter
Honored Contributor

Re: 'dir' on logicals for concealed devices


Instead of explicitly specifying device names, it is far better to use the F$TRNLNM lexical function to dynamically translate the inner logical to a device name.

For example:


Note that the ":" at the end of the device name is part of the string returned by F$TRNLNM. I strongly suggest careful understanding of the behavior of the lexical function before use, but this is far safer than explicitly inserting device names.

I also recommend reading my series of OpenVMS Consultant articles on OpenVMS.org relating to the use of logical names. The first article in the series can be found at:

- Bob Gezelter, http://www.rlgsc.com
Jess Goodman
Esteemed Contributor

Re: 'dir' on logicals for concealed devices


A concealed logical name definition CAN use another logical name, as long as that logical name is a concealed name defined as a physical device name. A common example is:

$ DEFINE/TRAN=CONCEAL logical DISK$volume:[dir.]

This has been supported since VMS 6.0. IIRC.
I have one, but it's personal.
Joseph Huber_1
Honored Contributor

Re: 'dir' on logicals for concealed devices

You did not show from which default You are issuing the Directory command.
effectively results in
DIR LOCAL_ROOT:[current_default].
Do a SHOW DEFAULT on the 2 systems in question.

The twice listing behaviour can be explained, if the current default is a list logical like SYS$COMMON or any other such logical list.
Occasional Visitor

Re: 'dir' on logicals for concealed devices

I had just figured that out for an hour ago, and just by accident, that if I did a 'set default local_root:' before listing the contents of local_root, then everything worked as expected (i.e. objects did show up only once).

One dcl-script that we use to changed between modules (and setting up various logicals) did set the default to the search-list which was defined from local_root + common_root.

Thank you all for your responses.

- Ingvaldur