Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.BERKELEY.EDU
Path: utzoo!decvax!decwrl!ucbvax!csnet-relay.arpa!jl%dac.triumf.cdn%ubc.CSNET
From: jl%dac.triumf.cdn%ubc.CSNET@CSNET-RELAY.ARPA (John Lloyd)
Newsgroups: mod.computers.vax
Subject: Yet another tree killer
Message-ID: <37:jl@dac.triumf.cdn>
Date: Wed, 30-Oct-85 22:38:20 EST
Article-I.D.: dac.37:jl
Posted: Wed Oct 30 22:38:20 1985
Date-Received: Thu, 31-Oct-85 10:35:27 EST
Sender: daemon@ucbvax.BERKELEY.EDU
Organization: The ARPA Internet
Lines: 25
Approved: info-vax@ucbvax.berkeley.edu

The following is a little more compact than Marty Sasaki's posting a
couple of weeks ago.  Note the recursive call inside:

$ ! Delete directory tree  JA Lloyd 83 12 16
$    if "" .nes. P1 then goto doit
$    inquire P1 "What disk and subdirectory ?"
$doit:
$    if "" .eqs. P2 then P2 = 0
$    P2=1+P2
$    disk=f$parse(P1,"","","DEVICE")
$    base=f$parse(P1,"","","DIRECTORY")
$
$ subloop:
$    on warning then exit 1
$    context = f$search(disk+base+"*.DIR",P2) 
$    if "" .eqs. context then goto delete_some
$    subname   = f$parse(context,"","","NAME")
$    subcontext= disk + base - "]" + "." + subname + "]"
$    @DISK$USER:[JAL]deltree 'subcontext 'P2
$ goto subloop
$
$ delete_some:
$    write sys$output "will DELETE ",disk,base,"*.*;*"
$    DELETE 'DISK''BASE*.*;*
$    exit 1