d$!{DO} KILL directory.subdirectory... {YES} $! Kill a directory ,$! $! If the directory is not empty, then the contents are listed, $! and the user is asked if he wishes to delete the non-empty directory X$! $! If the user entered YES, either in the CALL, or the response, $! then the directory is KILLed anyway $! $! note.. Creates and Deletes KILLWORK.VX L$! $!-end.of.info- $ x$ if( 'f$length( p1 ).eq.0 ) then inquire p1 "_KILL what" $ if( p1 .eqs."" ) then exit @$ $ if( 'f$locate("[",p1).eqs.'f$length(p1) ) then p1 := ['p1' $ if( 'f$locate("]",p1).eqs.'f$length(p1) ) then p1 := 'p1'] l$ if('f$locate(":",p1).eqs.'f$length(p1)) then -  p1 := 'f$logical("SYS$DISK")''p1' 4$ assign/user nl: sys$output $ directory 'p1'/out=KILLWORK.VX $ open/err=notdir killwork KILLWORK.VX ` $ read/end=nofile killwork line $ close killwork ( $ copy killwork.VX sys$output $ delete KILLWORK.VX;* $ if( p2.eqs."YES" ) then goto yeskill T $ inquire killit "_Note ''p1' still has files, Kill it <~y>" $ killit := 'f$extract(0,1,killit)  $ if(killit.nes."Y") then exit $ $yeskill: H $ del 'p1'*.*.* $ goto dokill $ t$nofile: $ close killwork <$ delete KILLWORK.VX;* $ $dokill: h$ len = 'f$length(p1) $ pos = len 0$ $finddir: $ if( "''f$extract( pos,1,p1 )'" .eqs. "." ) then goto gotdir \$ pos = pos-1 $ if( pos.gt.0 ) then goto finddir $$ ilbr = 'f$locate("[",p1)+1 $ irbr = 'f$locate("]",p1) $ hold := 'f$extract(0,ilbr,p1)'0,0] P$ ilen = irbr - ilbr $ name := 'f$extract(ilbr,ilen,p1)'.dir $ goto killmain |$ $notdir: D$ write sys$output "_NO!! ",p1," isn't a subdirectory." $ exit $ p$gotdir: $ hold := 'f$extract(0,pos,p1)"]" 8$ loc = pos+1 $ siz = len-pos-2 $ name := 'f$extract(loc,siz,p1)".dir" d$ $killmain: ,$ write sys$output "_O.K. ",p1," is dead." $ set/protection=w:d 'hold''name' $ delete 'hold''name';*