[Info-vax] Porting logical name applications to Unix
ChaosLess
james at enduring.com
Mon Sep 28 11:21:31 EDT 2009
On Sep 27, 8:13 pm, JF Mezei <jfmezei.spam... at vaxination.ca> wrote:
> Paul Raulerson wrote:
> > The
> > idea of course is to use generic file names in the programs, and
> > attach them at runtime.
>
> Ok, what is the best way to achieve this ? VMS has logical names, and
> MVS has DD statements in JCL and their equivalent in TSO. With Unix, do
> you open "input.dat" and then create a link in the directory called
> "input.dat" which points to the actual file ?
two of the many features of logical names are:
*) logicals can be updated and immediately available to all within
scope of the logical; and
*) logicals have scope, e.g. process, job, group, system, cluster.
if you need these features in unix then that implies more work. if
all you need is to substitute the name of a file to open, if you only
need the configuration values to be 'read only', then environment
variables might just do the trick.
it is common for environment variables to be setup in the shell
login / startup process - there are files you'd have in the $HOME for
a user that get sourced automagically - $HOME/.profile or
$HOME/.bashrc for example. info on these will be in the shell you
choose. and the examples above of per-user config files similar to
$HOME/.myapprc
there are some rough equivalents for scope - that you might exploit:
process (more like image id) - getpid() or $$ in the shell
job - getpgrp() - is generally everything running from your login
session
group - user accounts have a primary 'group'
system - /etc/myapp
hope that is helpful.
/james
More information about the Info-vax
mailing list