Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!cbatt!ucbvax!IAGO.CALTECH.EDU!rankin%EQL.Caltech.Edu From: rankin%EQL.Caltech.Edu@IAGO.CALTECH.EDU.UUCP Newsgroups: mod.computers.vax Subject: re: is "x.Dir" really a directory? Message-ID: <870226130237.002@EQL.Caltech.Edu> Date: Thu, 26-Feb-87 16:07:07 EST Article-I.D.: EQL.870226130237.002 Posted: Thu Feb 26 16:07:07 1987 Date-Received: Sat, 28-Feb-87 06:15:33 EST Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet Lines: 19 Approved: info-vax@sri-kl.arpa 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