[comp.os.vms] VMS logicals help -> dir and -> sub-dir

kjb@zycad.UUCP (Kevin Buchs) (02/07/88)

I would like to define a logical such that it could be used to refer to a
specific directory and could be used to refer to sub-directories of that
directory ( by appending on the [sub-dir] ).  We are at VMS 4.5.

If I define a logical as node::disk:[directory] then there is no way to
refer to subdirectories.  If I instead define the logical as
node::disk:[directory.] (notice the trailing dot) then this logical does
allow [sub-directory] to be appended.  It however cannot be used without
appending a subdirectory, and there is no way to append a null subdirectory.

I started playing with logical lists in an effort at solving my problem.
I noticed some strange behavior.  Here is the transcript of what I did:

$ sho log log1
   "LOG1" = "USER$DISK:[BUCHS.]" (LNM$PROCESS_TABLE)
	= "USER$DISK:[BUCHS]"
$ sho log log2
   "LOG2" = "USER$DISK:[BUCHS]" (LNM$PROCESS_TABLE)
	= "USER$DISK:[BUCHS.]"
$ dir log1

Directory USER$DISK:[BUCHS]

.CSHRC;1            AN.DIR;1            APOLLO.DIR;1        BIN.DIR;1          
...
...
XX.COM;1            ZLS.DIR;1           

Total of 110 files.
$ dir log1:[spike]

Directory USER$DISK:[BUCHS.][SPIKE]

.CMSRC;1            BUFFER.MAC;1        CMS.DIR;1           DEMO.DAT;4         
...
...
STIM5.WAV;1         STUB.COM;4          STUB.COM;3          STUB.DIR;1         
%DIRECT-E-OPENIN, error opening LOG1:[SPIKE] as input
-RMS-F-DIR, error in directory name
TEQ.C;2             TEQ.C;1             

Total of 90 files.
$ dir log1:[spike][.spike]
%DIRECT-E-OPENIN, error opening LOG1:[.SPIKE] as input
-RMS-F-DIR, error in directory name
$ dir log2:[spike]
%DIRECT-E-OPENIN, error opening LOG2:[SPIKE] as input
-RMS-F-DIR, error in directory name
$ dir log2:[.spike]
%DIRECT-E-OPENIN, error opening LOG2:[.SPIKE] as input
-RMS-F-DIR, error in directory name


Notice the output from : dir log1:[spike]?  The error message
comes out in the middle of the first directory listing.  Is a VAX 785 really
a parallel machine?  The logical log1 seems to be somewhat of a solution to
my problem, but I need to get rid of the error message.

If anyone has any good ideas on this please let me know.
-- 
Kevin Buchs   3900 Northwoods Dr. Arden Hills, MN 55112  (612)490-2548
Zycad Corp.   pwcs!zycad!kjb

scjones@sdrc.UUCP (Larry Jones) (02/09/88)

In article <722@zycad.UUCP>, kjb@zycad.UUCP (Kevin Buchs) writes:
< 
< If I define a logical as node::disk:[directory] then there is no way to
< refer to subdirectories.  If I instead define the logical as
< node::disk:[directory.] (notice the trailing dot) then this logical does
< allow [sub-directory] to be appended.  It however cannot be used without
< appending a subdirectory, and there is no way to append a null subdirectory.

Au contraire (forgive my spelling if incorrect) - there is a way to append a
null subdirectory.  Just use [000000] like you would on a real disk.

< $ dir log1:[spike]
< 
< Directory USER$DISK:[BUCHS.][SPIKE]
< 
< .CMSRC;1            BUFFER.MAC;1        CMS.DIR;1           DEMO.DAT;4         
< ...
< ...
< STIM5.WAV;1         STUB.COM;4          STUB.COM;3          STUB.DIR;1         
< %DIRECT-E-OPENIN, error opening LOG1:[SPIKE] as input
< -RMS-F-DIR, error in directory name
< TEQ.C;2             TEQ.C;1             
< 
< Total of 90 files.
< 
< Notice the output from : dir log1:[spike]?  The error message
< comes out in the middle of the first directory listing.  Is a VAX 785 really
< a parallel machine?

Nope.  I SPRed this a long time ago but DEC doesn't consider it enough of a
problem to bother fixing.  The output of the DIRECTORY command is buffered
and they don't bother to flush the buffer before printing error messages so
you get the message in the middle of your listing.  You can usually get the
same effect from $ DIRECTORY DISK:[*...] as you run into directories where
you don't have read permission.
-- 

----
Larry Jones                         UUCP: uunet!sdrc!scjones
SDRC                                MAIL: 2000 Eastman Dr., Milford, OH  45150
                                    AT&T: (513) 576-2070
"When all else fails, read the directions."

jeh@crash.cts.com (Jamie Hanrahan) (02/10/88)

In article <722@zycad.UUCP> kjb@zycad.UUCP (Kevin Buchs) writes:
>I would like to define a logical such that it could be used to refer to a
>specific directory and could be used to refer to sub-directories of that
>directory ( by appending on the [sub-dir] ).  We are at VMS 4.5.
>
>...  If I define the logical as
>node::disk:[directory.] (notice the trailing dot) then this logical does
>allow [sub-directory] to be appended.  It however cannot be used without
>appending a subdirectory, and there is no way to append a null subdirectory.

Well, actually, there is, though it's not obvious how.  You just use [000000]
after the logical that specifies the root.  For example, try 

	$ DIRE SYS$SYSROOT:[000000]

You'll get a directory of [SYS0], or [SYS1], or whatever SYS$SYSROOT points
to on your node.  

dave@wsccs.UUCP (VAX Headroom @ The End of the Galaxy) (02/18/88)

In article <722@zycad.UUCP>, kjb@zycad.UUCP (Kevin Buchs) writes:
> 
> If I define a logical as node::disk:[directory] then there is no way to
> refer to subdirectories.  If I instead define the logical as
> node::disk:[directory.] (notice the trailing dot) then this logical does
> allow [sub-directory] to be appended.  It however cannot be used without
> appending a subdirectory, and there is no way to append a null subdirectory.

$ define x node::disk:[directory.] /translate=conceiled

$ dir x:[000000] will give you the top directory.
I like to refer to logical names defined the way x above is as "fake
devices"
since they will appear to be a device in directory listings and they
act like devices.  000000 is how you get THE root directory on a disk
like dir $disk1:[000000].  We used to have $disk1 defined as
sys$sysdevice:[disk1.]/trans=conc when we had one disk drive and put
our users there.  When we got a new disk drive we redefined $disk1 to be
dub0:/trans=conc and did a copy sys$sysdevice:[*...] $disk1:[...]
and it worked fine.  No changes to the authorize records were necessary.

Anyway, 000000 is equivalent to the "root" directory on a "device", or,
if you prefer, a null directory.

you may occasionally see outputs from these types of things as
dua0:[disk1.][000000] or dua0:[disk1.][user1.c]
Also, this only works once, you can't have
define x dua0:[disk1.]/trans=conc
define y x:[xyz.]/trans=conc
as the result of dir y:[a] would be
(internally)
dir dua0:[disk1.][xyz.][a]
and VMS wont buy this.  (at least the last time I tried it.)

Also, using "fake devices" it is possible to get directories more
than eight levels deep.

+-----------------------------------------------------------------------------+ 
|		    |	     Dave E Martin       | DISCLAIMER: Been Cancelled |
|    /\		    | "...between the streets of | $ opinion/mine/noUinTech   |
|   /  \  .    /\   | Dallas, and the beaches of |----------------------------|
|  /    \/ \/\/  \  | Miami ...  THIS  was   Max | ...!ihnp4!utah-cs!utah-gr! |
| / U i n T e c h \ | Headroom's  finest  hour." | uplherc!sp7040!obie!       |
|		    |	          --Max Headroom | wsccs!net23.dnet!dave      |
+-----------------------------------------------------------------------------+