  L /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  *  *  *<  *                %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\=  *                %% \___________________________________%% \ >  *                %% |                                   %%  \?  *                %% |              REMTREE              %%   \ @  *                %% |          remtree.c  c2004         %%    \@  *                %% |            Lyle W. West           %%    |@  *                %% |                                   %%    |@  *                %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    |@  *                \                                        \   |@  *                 \                                        \  |@  *                  \                                        \ |@  *                   \________________________________________\|  *  *  *9  *  Copyright (C) 2004 Lyle W. West, All Rights Reserved. J  *  Permission is granted to copy and use this program so long as [1] thisH  *  copyright notice is preserved, and [2] no financial gain is involvedH  *  in copying the program.  This program may not be sold as "shareware"G  *  or "public domain" software without the express, written permission   *  of the author.  *M  *  REMTREE has been designed as a system management tool and is not intended J  *  to be accessed by general users. As described below, certain privs areJ  *  required to succesfully execute REMTREE. Additionally, if the image isJ  *  located where global access is available, it is prudent for the sysmgr   *  to have trusted users enter:  *,  *      DEFINE /JOB /EXEC SECURE_LNM ENABLED  *J  *  prior to attempting execution. REMTREE requires SYSPRV to successfullyD  *  complete certain RMS calls. If SETPRV is enabled for the caller,I  *  the above privs will be enabled for the duration of image activation. I  *  If not, user will see 'RMS-E-PRV' message at exit. If image is built  H  *  with SECURE defined, user will see 'SYSTEM-x-AUTHFAIL' if there is a@  *  discrepancy with LNM definition. See source (#ifdef SECURE).  *E  *  Note that this information is not documented elsewhere. This is a G  *  poor mans substitute for an identifier, most unpriv'ed users cannot K  *  access another users job table. There may be some user with the ability J  *  to determine the need for this logical to be defined in the JOB table,E  *  but not be able to define it with EXEC priv. See the source code     *  (search for 'ifdef SECURE').  *  *M  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */          REMTREE (V1.2-2)  A         Deletes all subdirectories and respective files in a tree 0         specified by the command line parameter.         Parameter:  D         PATH - the filepath to the file tree of subdirectories to beH                 removed. The filepath can be specified by use of logical#                 names. For example:   4                         $ REMTREE /LOG AXPECO:[V731]         Qualifiers  J         /CONFIRM - REMTREE will prompt the user to confirm deletion of theL                 specified file. The user is presented with options clause ofI                 (Yes, No, All, Quit). Responding with 'Yes' deletes file. K                 Responding with 'All' deletes all files in that dir without L                 further confirmation. Entry of 'No' or 'Quit' exits program.  G         /LOG - if present, REMTREE will log to sys$output all directory 8                 paths, file deletions, and blocks freed.  H         /RETAIN - if present, REMTREE will not delete the base directoryJ                 and the files in that directory. If omitted, the files andG                 the base directory, as specified in PATH parameter, are *                 removed without prompting.  "         /HELP - Displays this text  0         /VERSION - Displays version, build date,;                 and required privs for VMS Install utility.        Sample Output:  " $ deltree /log disk$asuser:[valid]  +  Target: DISK$ASUSER:[VALID.SUBDIR1.LAYER3] 4                GCOMPRESS.EXE;1 deleted, 40/48 blocks3            GETIMAGEVERS.COM;11 deleted, 4/12 blocks 3                  GETVERS.COM;5 deleted, 1/12 blocks 4                   GLOGIN.EXE;1 deleted, 25/24 blocks6                   GUNZIP.EXE;1 deleted, 178/180 blocks6                     GZIP.EXE;1 deleted, 213/212 blocks6                        6 files deleted, 461/488 blocks  $  Target: DISK$ASUSER:[VALID.SUBDIR1]2                    HGFTP.COM;1 deleted, 1/4 blocks3                     HOST.COM;2 deleted, 1/12 blocks 2                     HOST.LST;1 deleted, 2/4 blocks3                  HSD_VAX.COM;1 deleted, 1/12 blocks 3                      HSJ.COM;1 deleted, 1/12 blocks 3                  HSJ_VAX.COM;1 deleted, 1/12 blocks 3                        6 files deleted, 7/56 blocks   2  Target: DISK$ASUSER:[VALID.SUBDIR2.LEVEL3.LEVEL4]2                       AC.COM;1 deleted, 2/8 blocks2                   ACCESS.TXT;3 deleted, 1/4 blocks4                    ACODE.DAT;2 deleted, 10/20 blocks2                AGEN_TUNE.COM;1 deleted, 7/8 blocks4                    ALERT.EXE;1 deleted, 13/20 blocks6                   ASBARB.TXT;1 deleted, 190/192 blocks3                       ASCII.;3 deleted, 5/12 blocks 6                        7 files deleted, 228/264 blocks  )  Target: DISK$ASUSER:[VALID.SUBDIR2.LAST] 4                       BILF.C;4 deleted, 13/16 blocks2                     BILF.DOC;1 deleted, 1/4 blocks4                     BILF.EXE;1 deleted, 14/16 blocks4                        3 files deleted, 28/36 blocks  +  Target: DISK$ASUSER:[VALID.SUBDIR2.LEVEL3] 4                      CAL.EXE;1 deleted, 32/32 blocks2                     CALC.COM;1 deleted, 1/8 blocks3                CALC_VUPS.COM;1 deleted, 4/12 blocks 3                     CCRT.COM;1 deleted, 1/12 blocks 4                  CDMOUNT.EXE;1 deleted, 28/28 blocks2                     CDST.COM;1 deleted, 3/4 blocks2                 CD_MOUNT.COM;2 deleted, 5/8 blocks3                 CD_TOOLS.COM;1 deleted, 1/12 blocks 3                   CD_TOP.COM;1 deleted, 1/12 blocks 4               CHANGE_EWS.COM;1 deleted, 10/20 blocks2                 CHC_KEYS.LRN;1 deleted, 1/4 blocks4               CHECKTERM.EXE;10 deleted, 26/28 blocks2      CHECK_NPAGEDYN_FRAG.COM;1 deleted, 6/8 blocks4             CHECK_SECURE.EXE;1 deleted, 15/16 blocks4                   CHFDAT.EXE;1 deleted, 47/48 blocks4                   CHFNAM.EXE;1 deleted, 40/40 blocks4                   CHFOWN.EXE;1 deleted, 33/32 blocks4                   CHFPRO.EXE;1 deleted, 41/40 blocks4                   CHFVER.EXE;2 deleted, 54/54 blocks3          CHK_FOR_PROCNAM.COM;1 deleted, 2/12 blocks 8                  CKERMIT.EXE;1 deleted, 2148/2152 blocks3                      CLR.COM;5 deleted, 1/12 blocks 3                 CLUS-DST.OUT;1 deleted, 4/12 blocks 3        CLUSTER_MODPARAMS.TMP;2 deleted, 7/12 blocks 4                    CMDS.COM;56 deleted, 14/16 blocks4                   CMPDIR.EXE;1 deleted, 41/40 blocks4                 COMATOSE.EXE;1 deleted, 39/40 blocks2                 COV-LNMS.COM;1 deleted, 3/4 blocks4                  CVLST2SRC.C;3 deleted, 21/24 blocks4               CVTLST2SRC.EXE;1 deleted, 29/28 blocks2                     CWD.COM;20 deleted, 6/8 blocks8                       31 files deleted, 2664/2778 blocks  $  Target: DISK$ASUSER:[VALID.SUBDIR2]2                  FCMPDIR.CLD;2 deleted, 5/8 blocks2                  FCMPDIR.COM;2 deleted, 1/4 blocks4                  FCMPDIR.EXE;1 deleted, 67/68 blocks4                     FILE.EXE;4 deleted, 45/44 blocks4                FILEDATES.EXE;1 deleted, 33/32 blocks2               FILES_INFO.CLD;2 deleted, 1/4 blocks4               FILES_INFO.EXE;1 deleted, 25/24 blocks4           FILES_INFO.OLD-EXE;1 deleted, 12/12 blocks2                   FILSIZ.EXE;1 deleted, 5/8 blocks2                     FIND.EXE;1 deleted, 8/8 blocks2           FIND_BIG_FILES.COM;1 deleted, 2/4 blocks3                FIX_SAVESET.C;1 deleted, 4/12 blocks 4              FIX_SAVESET.EXE;1 deleted, 10/12 blocks4         FIX_TIME_OF_DAY.BACK;2 deleted, 12/12 blocks3                     FRAG.COM;1 deleted, 1/12 blocks 4                     FREE.EXE;1 deleted, 13/12 blocks4                  FTATERM.EXE;1 deleted, 38/40 blocks4             FTPFIXUP_AXP.EXE;1 deleted, 71/72 blocks4                FUNCTIONS.EXE;1 deleted, 30/32 blocks6                       19 files deleted, 383/420 blocks    Target: DISK$ASUSER:[VALID]4                DECTERMRC.EXE;1 deleted, 14/14 blocks2    DECW$TERMINAL_DEFAULT.DAT;1 deleted, 2/2 blocks3                ICON_NAME.COM;4 deleted, 4/12 blocks 4                 IDLEPROC.EXE;1 deleted, 34/36 blocks3                    IMAGE.COM;1 deleted, 1/12 blocks 2                  IMAGEID.EXE;5 deleted, 8/8 blocks4                    IMGID.EXE;2 deleted, 11/12 blocks2            INIT-QUE.TEMPLATE;1 deleted, 4/8 blocks3                      IOX.DAT;1 deleted, 1/12 blocks 6                      IOX.EXE;1 deleted, 303/308 blocks6                       10 files deleted, 382/424 blocks  G %DELTREE-I-SUMMARY, deleted 89 files in 7 directories, 4153/4466 blocks . %DELTREE-I-TIME, elapsed time    0 00:00:06.33   $                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       