From:	SMTP%"RELAY-INFO-VAX@CRVAX.SRI.COM" 25-JUN-1994 09:56:44.99
To:	EVERHART
CC:	
Subj:	Re: A copy of DRAWTREE

From: Dale Dellutri <ddellutri@delphi.com>
X-Newsgroups: comp.os.vms
Subject: Re: A copy of DRAWTREE
Date: Sat, 25 Jun 94 09:01:44 -0500
Organization: Delphi (info@delphi.com email, 800-695-4005 voice)
Lines: 88
Message-ID: <x+xSYfY.ddellutri@delphi.com>
NNTP-Posting-Host: bos1d.delphi.com
X-To: Jim Cragen <cragen@aspentec.com>
To: Info-VAX@CRVAX.SRI.COM
X-Gateway-Source-Info: USENET

Jim Cragen <cragen@aspentec.com> writes:
 
>Does anyone have or know where I can get a copy of a DCL com file
>called DRAWTREE which draws a directory structre from your current
>directory down.
>
>Thanks.
>
>-------------------------------------------------------------------------------
>Jim Cragen 		      Email: <cragen@ASPENTEC.COM>
 
Here's a version I wrote:
$!
$! @DIRECTORY_TREE SN FILE
$! Writes a directory tree starting at SN to file FILE
$! Where SN can be one of three forms:
$!  1. DEVICE:[DIRECTORY]
$!  2. Logical name
$!  3. * (Current default DEVICE:[DIRECTORY])
$! If FILE is omitted, writes to DIRECTORY_TREE.LIS
$! Examples:
$!  @DIRECTORY_TREE DKA200:[000000] DKA200.LIS
$!   Writes a directory tree for the entire volume DKA200 to file DKA200.LIS
$!  @DIRECTORY_TREE SYS$LOGIN
$!   Writes the directory tree starting from the login directory
$!   to DIRECTORY_TREE.LIS
$!  @DIRECTORY_TREE DKA300:[SYS0.SYSMGR]
$!   Writes the directory tree starting from DKA300:[SYS0.SYSMGR]
$!   to DIRECTORY_TREE.LIS
$!  @DIRECTORY_TREE * HERE.LIS
$!   Writes the directory tree starting from the default directory to HERE.LIS
$!
$
$ SEARCH: SUBROUTINE
$ SN = P1 + ":[" + P2 + "]*.DIR"
$ I = I + 1
$ LOOP:
$ FN = F$SEARCH(SN,I)
$ IF FN .EQS. "" THEN GOTO DONE
$ NN = F$PARSE(FN,,,"NAME","SYNTAX_ONLY")
$ J = 24 - F$LENGTH(NN) - I - 4
$ IF J .GT. 0
$ THEN
$ OL = F$FAO(" !2ZL !#* !AS!#* !AS.!AS",I,I,NN,J,P2,NN)
$ ELSE
$ OL = F$FAO(" !2ZL !#* !AS",I,I,NN)
$ WRITE TL OL
$ OL = F$FAO("!24* !AS.!AS",P2,NN)
$ ENDIF
$ WRITE TL OL
$ IF NN .EQS. "000000" THEN GOTO LOOP
$ ND = P2 + "." + NN
$ CALL SEARCH 'P1' 'ND'
$ GOTO LOOP
$ DONE:
$ I = I - 1
$ ENDSUBROUTINE
$ IF P1 .EQS. "" THEN GOTO BADP1
$ IF P1 .EQS. "*"
$ THEN
$ DVDR = F$ENVIRONMENT("DEFAULT")
$ ELSE
$ DVDR = F$TRNLNM("''P1'")
$ IF DVDR .EQS. "" THEN DVDR = P1
$ ENDIF
$ K = F$LENGTH(DVDR)
$ J = F$LOCATE("[",DVDR)
$ J = J - 1
$ IF J .GE. K - 3 THEN GOTO BADP1
$ DV = F$EXTRACT(0,J,DVDR)
$ IF F$EXTRACT(J,1,DVDR) .NES. ":" THEN GOTO BADP1
$ IF F$EXTRACT(K-1,1,DVDR) .NES. "]" THEN GOTO BADP1
$ DR = F$EXTRACT(J+2,K-2-J-2+1,DVDR)
$ RL = F$FAO(" Directory tree for !AS:[!AS]",DV,DR)
$ I = 0
$ IF P2 .EQS. "" THEN P2 = "DIRECTORY_TREE.LIS"
$ OPEN/WRITE TL 'P2'
$ WRITE TL RL
$ CALL SEARCH 'DV' 'DR'
$ CLOSE TL
$ EXIT
$ BADP1:
$ WRITE SYS$ERROR "Bad search parameter (P1): ",P1
$ EXIT %X80000000
 
Dale
--
  --  Dale Dellutri - ddellutri@delphi.com  --

