1

I wonder about an apparent limitation to the flexibility of using filenames and logical names (~ filename aliases in this context) on VMS. You can have names like [dir]name or [.subdir]name and you can combine them with a device like dskxy:[dir]name or even dskxy:[.subdir]name. Then there are logical names, e.g. SYS$LOGIN and you can form filenames like SYS$LOGIN:name. A natural use of this would be SYS$LOGIN:[.subdir]name but that does not seem to be accepted. Did I overlook something or is it just as inflexible?

Hein
  • 1,453
  • 8
  • 8

2 Answers2

2

sys$login is not a good equivalent for "home" root as it's rather a logical directory, to which you need to "set default".

In case you need to reference directories under "home", you may want to define a root/device-logical that corresponds to the sys$login directory.

$ define/job home$r 'f$str(f$trnlnm("sys$login")- ".]["-"]" + ".]") /trans=conceal

Note ".]" and "conceal", these would define it as rooted device. It's good to remember that one cannot have double-concealed logical, as CLI translates it only once (thus subtracting ".][" from the translated sys$login). This defines it on "job-level", that is all processes in your job will know it.

Having this define in your LOGIN.COM will let you reference things like: home$r:[mydir] equivalent to "/home$r/mydir"

Hope it would make your VMS experience more satisfying.

vmsnomad
  • 319
  • 2
  • 7
2

Indeed it can frustrating that SYS$LOGIN:[.X] does not parse. Too late in the game to consider fixing this towards 'do what I mean, not what I say'. OpenVMS policy is to 'do what I say, and do it well'.

It kinda makes sense if you consider that the example maps to an invalid syntax:

dev:[logindir][.x]

But this would work:

dev:[logindir.][x]

Subtle but all important difference in placing that "." One could perhaps argue that any "][" should silently be dropped huh?

The dskxy:[.subdir]name works because the current default directory is woven in there. It maps to dev:[default_dir.subdir]name

And therein lies perhaps the reason this was never changed. Should SYS$LOGIN:[.X] include the current default directory in the parse or not? You expect not, but the dominant existing OpenVMS behavior says it should be there.

You can sometimes sort of work around it by defining a rooted directory for example:

$ define/trans=conceal sys_login dev:[default_dir.]

Now you can say $ dir sys_login:[subdir]

But now the leading period must not be there, and the logical on its own does nothing. It needs sys_login:[000000] to work.

Not really helping you here am I?

Hope this helps a little, Hein

Hein
  • 1,453
  • 8
  • 8