From:	SMTP%"RELAY-INFO-VAX@CRVAX.SRI.COM" 16-SEP-1993 12:19:50.09
To:	EVERHART
CC:	
Subj:	Re: Name wanted for rooted directory logname "SYS$LOGIN_ROOT"

From: hoadley@makara.anu.edu.au (David Hoadley)
X-Newsgroups: comp.os.vms
Subject: Re: Name wanted for rooted directory logname "SYS$LOGIN_ROOT"
Date: 14 Sep 1993 23:34:51 GMT
Organization: Mt. Stromlo and Siding Spring Observatories
Lines: 111
Message-Id: <275ker$jf6@manuel.anu.edu.au>
Nntp-Posting-Host: 150.203.89.5
To: Info-VAX@kl.sri.com
X-Gateway-Source-Info: USENET

In article <15584412@MVB.SAIC.COM>
moeller@gwdgv1.dnet.gwdg.de (GWDGV1::MOELLER) writes:
>Quite a few VMS users that own subdirectories and have a chance
>to SET DEFAULT to directories different from their own tree
>("rooted" at SYS$LOGIN) might have felt the necessity to define
>a rooted logical defining their SYS$LOGIN directory as "root".
>
>I do wonder what a meaningful name for such a thing could be
>(actually I've been using a pretty cryptic name for years);
>I wouldn't like SYS$LOGIN_ROOT because it's so long, and I personally
>don't find the term "root" particularly well suited to the real concept.
>U*IX people might think of SYS$TILDE, but there got to be something better ;-)

Well, for me this is just one example of a more general problem, in that
I have many directories that I wish to treat as "roots" of their respective
sub-trees. (Or do I mean "trunks" and "branches"?--the terminology is getting
away a bit here!)

So I have a fairly ugly solution, in that I create a rooted logical name for
each directory logical name, which differs only by a trailing underscore:
   for SYS$LOGIN,   get SYS$LOGIN_
   for TEL_LIBRARY, get TEL_LIBRARY_   etc.

(I prefer this to appending the entire string "_ROOT").
I have a simple command procedure to do this, which follows. It isn't
bullet-proof, but it does the basic job.

>Once a good name was found, we could even ask DEC to provide the definition
>of that logname as a standard feature (it's long overdue IMHO) ...

Well, that will certainly introduce new users quickly to one of the
idiosyncracies of VMS! After all, we all know that a certain other
operating system doesn't have this problem:
  cd ${HOME}
  cd ${HOME}/work
are both legal commands there. What a funny thing RMS is!

David.

$!*****************************************************************************
$!
$! TITLE : CVT_TO_ROOTED
$!
$! (full description at end of file)
$!*****************************************************************************
$!
$ p1 = p1 - ":"
$ if f$trnlnm( p1 ) .eqs. ""
$ then
$    write sys$output p1, " is not a logical name"
$    exit
$ endif
$!
$ TransName = f$parse( p1,,,, "no_conceal" ) - "][" - "].;"
$ if f$parse( TransName,,, "name" ) .nes. ""
$ then
$     write sys$output p1, " does not specify a directory"
$ else
$     define/job  'p1'_  'TransName'.]/translation=(concealed, terminal)
$ endif
$ exit
$!
$!*****************************************************************************
$!
$! TITLE : CVT_TO_ROOTED
$! -----
$!
$! VERSION : 1-001
$! -------
$!
$! FACILITY : General use
$! --------
$!
$! ABSTRACT :
$! --------
$!   This routine takes a normal logical name as a parameter and defines a
$!   companion "rooted" logical name, in the job table. The companion name
$!   is the same as the supplied one, with an underscore appended.
$!   e.g. If the definitions	DISK_STAFF = DUA0:[USER.STAFF.]
$!				FREDS_WORK = DISK_STAFF:[FRED.WORK]
$!   already exist, then the line
$!	@Cvt_To_Rooted FREDS_WORK
$!   will create the definition	FREDS_WORK_ = DUA0:[USER.STAFF.FRED.WORK.]
$!   which enables constructions like FREDS_WORK_:[SOURCE]
$!
$! PARAMETERS :
$! ----------
$!	P1	The logical name of a directory, to convert
$!
$!
$! AUTHOR : David Hoadley
$! ------
$!          Mount Stromlo and Siding Spring Observatories,
$!          Australian National University.
$!
$! DATE : 19-Jul-1991
$! ----
$!
$! MODIFICATION HISTORY :
$! --------------------
$!	1-001	David Hoadley		19-Jul-1991
$!		- initial version
$!
$!*****************************************************************************


-- 
-------------------------------------------------------------------------------
David Hoadley                         INTERNET: hoadley@mso.anu.edu.au
Mount Stromlo Observatory,            Tel: +61 6 249-0288  Fax: +61 6 249-0233
The Australian National University, Canberra, Australia

