[Info-vax] Porting logical name applications to Unix
Bob Koehler
koehler at eisner.nospam.encompasserve.org
Mon Sep 28 09:21:06 EDT 2009
JF Mezei 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 ?
UNIX people will tell you to use links in place of logical names.
That can be used in limitied circumstance:
If the program does an open on "able", and you link an "able" in your
current directory to the actual target file, that's somewhat like
defining logical name "able" to point to a file in VMS.
In practice UNIX folks either translate shell symbols, like you're
suggesting, or read a configuration file in a known location, like
I think Arne suggested. You don't really get the full power of
logical names, but it's generally good enough.
More information about the Info-vax
mailing list