[Info-vax] Porting logical name applications to Unix
Alan Winston - SSRL Central Computing
winston at SSRL.SLAC.STANFORD.EDU
Mon Sep 28 14:57:14 EDT 2009
In article <bc4de133-2255-447a-8632-ed49b4aa5372 at o13g2000vbl.googlegroups.com>, ChaosLess <james at enduring.com> writes:
>On Sep 27, 8:13=A0pm, 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 =A0
>> > 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. =A0With Unix, d=
>o
>> 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
They *can*, but in fact (on VMS, even) whether your C program will immediately
start acting on the updated translation depends on the setting of a C
runtime logical name. (We got better performance from Apache when we had it
cache the translation rather than retranslating hundreds of thousands of
times).
-- Alam
> *) 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