[Info-vax] Porting logical name applications to Unix

ChaosLess james at enduring.com
Sat Sep 26 16:14:41 EDT 2009


On Sep 25, 8:08 pm, JF Mezei <jfmezei.spam... at vaxination.ca> wrote:
> Ok, this is a generic question.
>
> Say I have a VMS application that uses logical names to point to files,
> devices etc.
>
> When porting to a Unix system, is the following the best way to mimic
> this : ?
>
> - use getenv to translate a symbol to some value stored in a local variable
> - use that variable instead of a quoted string when calling the file
> open, or open some serial device or whatever ?
>
> Or is there a better or different way to mimic logical names which most
> Unix based people would use ?

there really is nothing native in unix that will match logical names.
environment variables in unix are very limited (and only 1 way, a
'child' process really can't update a parent's environment).

for the S7 product, we wrote logical name handling from the ground up
as one of the first tasks a very long time ago - with support for
process, job, group, and system logicals.  subsequently this was
rewritten once the full scope of what logicals could really do became
clear.

ultimatley we create logical name tables as files, and these are
autogenerated when a process first starts to setup SYS$LOGIN, TT:,
etc... and if is first process ever on that machine, SYS$SYSTEM, SYS
$MESSAGE, etc...

part of the challenge for implementing logicals is the many ways in
which they can be accessed.   not only logical names from our DCL,
from unix utilities (e.g. trnlnm 'sys$login'), from system services
api and runtime libraries (sys$crelnm(), sys$crelnt(), etc..), but
also from language runtime extensions ( fopen() being a good
example ).   ultimately everything in unix resolves to some location
in the file system - and being able to reliably resolve this to
exactly match what would be expected under VMS is deceptively
complex.

even after adding a mapping layer for vms device names to unix
devices, and weaving that into logical name resolution - there is
still the complication where logical names are actually search lists,
and the inherent application capabilities that all involves.


if your use of logical names and devices is very simple and  you can
rewrite it to config files then you are lucky.  our experience is that
these are some of the features that are most entwined into what
applications expect to find in their (VMS native) environment.

i'd be happy to give you an evaluation copy to try out lnm and device
handling on unix.  if it is for your own personal use then am sure we
can extend that evaluation for a very long time period.

/james



More information about the Info-vax mailing list