[mod.computers.vax] is "x.Dir" really a directory?

rankin%EQL.Caltech.Edu@IAGO.CALTECH.EDU.UUCP (02/27/87)

Use f$parse() to determine from DCL whether a filespec ending in ".Dir"
is actually a valid Files-11 directory.

Break 'filespec' up into three parts:
     left:    node::device:[directory]   ! f$parse(f,,,"NODE") + f$parse...
     middle:  name            ! f$parse(f,,,"NAME")
     right:   .type;version   ! f$parse(f,,,"TYPE") + f$parse(f,,,"VERSION")

File type and version must be ".DIR;1" and length of name must be at >= 1.
Insert 'name' as a subdirectory into the directory specification.
 $ dirspec = f$extract(0,f$length(left)-1,left)  -! remove right bracket
            + "." + middle + "]"                  ! add subdirectory

Now use f$parse to determine whether this directory is accessible:
 $ its_a_dir = ( f$parse(dirspec).nes."" )
'f$parse(dirspec)' returns "node::device:[directory.subdir].;" if the
directory exists, null string ("") otherwise.  'f$parse("",dirspec)' also
works.
                                  Pat Rankin