[comp.os.vms] Forwarding mail.

HAROLD@UGA.BITNET (Harold C Pritchett) (03/02/88)

Message-ID: <INFO-VAX%88030115450639@UGA>
Date:         Thu, 25 Feb 88 13:14:00 EST
Reply-To:     "ETD1::LABOVITZ" <labovitz%etd1.decnet@afwal-aaa.arpa>
Sender:       INFO-VAX Discussion <INFO-VAX@UGA>
From:         "ETD1::LABOVITZ" <labovitz%etd1.decnet@afwal-aaa.arpa>
Subject:      re: recursive deletion
X-LSVRepTo: "ETD1::LABOVITZ" <labovitz%etd1.decnet@afwal-aaa.arpa>
X-LSVopts: NOACK Org=INFO-VAX@UGA
X-LSVvia:  INFO-VAX@UGA
X-LSVTo: info-vax@kl.sri.com info-vax
X-LSVcc: munnari!mimir!wacsvax!effigy!mail!j_smartt@uunet.uu.net
>>To: $PEER$ <MD4I@CMUCCVMA>

>Date: 19 Feb 88 08:37:08 GMT
>From: munnari!mimir!wacsvax!effigy!mail!j_smartt@uunet.uu.net
>Subject: recursive deletion
>Message-Id: <567004@mail.uwa.oz>
>Sender: info-vax-request@kl.sri.com
>To: info-vax@kl.sri.com
>
>G'day!,
>    does anybody have a VMS/DCL procedure to simulate the UNIX
>"rm -r *.*" command - i.e. to recursively remove all files at and below
>a given directory?
>
>Thanks,
>Jeff.
>

Since  the DCL code that we use here at our site is so short, I am appending
it to this message.  This procedure will recursively delete all files
(including .DIR files) below the directory supplied in the call to the
procedure.  All usual (and unusual!) disclaimers apply to this code!!!

            LT Stuart L Labovitz
            USAF Avionics Laboratory
        arpa:    Labovitz%Etd2.decnet@Afwal-aaa.arpa
    (or, if you must, arpa:    Labovitzsl@Afwal-aaa.arpa    )
$!...................... Cut on the dotted line and save ......................
$! VAX/VMS archive file created by VMS_SHAR V-5.04 04-Feb-1988
$! which was written by Michael Bednarek (U3369429@ucsvc.dn.mu.oz.au)
$! To unpack, simply save and execute (@) this file.
$!
$! This archive was created by LABOVITZ
$! on Thursday 25-FEB-1988 13:04:24.87
$!
$! It contains the following 1 file:
$! DELTREE.COM
$!=============================================================================
$Set Symbol/Scope=(NoLocal,NoGlobal)
$Version=F$GetSYI("VERSION")
$If Version.ges."V4.4" then goto Version_OK
$Write SYS$Output "Sorry, you are running VMS ",Version, -
", but this procedure requires V4.4 or higher."
$Exit 44
$Version_OK:CR[0,8]=13
$Pass_or_Failed="failed!,passed."
$Goto Start
$Convert_File:
$Read/Time_Out=0/Error=No_Error1/Prompt="creating ''File_is'" SYS$Command ddd
$No_Error1:Define/User_Mode SYS$Output NL:
$Edit/TPU/NoSection/NoDisplay/Command=SYS$Input/Output='File_is' -
VMS_SHAR_DUMMY.DUMMY
f:=Get_Info(Command_Line,"File_Name");b:=Create_Buffer("",f);
o:=Get_Info(Command_Line,"Output_File");Set(Output_File,b,o);
Position(Beginning_of(b));Loop x:=Erase_Character(1);Loop ExitIf x<>"V";
Move_Vertical(1);x:=Erase_Character(1);Append_Line;
Move_Horizontal(-Current_Offset);EndLoop;Move_Vertical(1);
ExitIf Mark(None)=End_of(b) EndLoop;Position(Beginning_of(b));Loop
x:=Search("`",Forward,Exact);ExitIf x=0;Position(x);Erase_Character(1);
If Current_Character='`' then Move_Horizontal(1);else
Copy_Text(ASCII(INT(Erase_Character(3))));EndIf;EndLoop;Exit;
$Delete VMS_SHAR_DUMMY.DUMMY;*
$Checksum 'File_is
$Success=F$Element(Check_Sum_is.eq.CHECKSUM$CHECKSUM,",",Pass_or_Failed)+CR
$Read/Time_Out=0/Error=No_Error2/Prompt=" CHECKSUM ''Success'" SYS$Command ddd
$No_Error2:Return
$Start:
$File_is="DELTREE.COM"
$Check_Sum_is=1867668381
$Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X$ !     DELTREE.COM - deletes a complete directory tree
X$ !
X$ !     P1 = pathname of root of tree to delete
X$ !
X$ !     All files and directories in the tree, including
X$ !     the named root, are deleted.
X$ !
X$ IF "''DELTREE'" .EQS. "" THEN DELTREE = "@SYS$COMMON:[OPERATOR]DELTREE"
X$ ON CONTROL_Y THEN GOTO DONE
X$ ON WARNING   THEN GOTO DONE
X$ DEFAULT = F$LOGICAL("SYS$DISK") + F$DIRECTORY()
X$10:
X$ IF P1 .NES. "" THEN GOTO 20
X$ INQUIRE P1 "Root"
X$ GOTO 10
X$20:
X$ IF F$PARSE(P1) .EQS. "" THEN OPEN FILE 'P1'
X$ SET DEFAULT 'P1'
X$ show default
X$LOOP:
X$ FILESPEC = F$SEARCH("*.DIR;1")
X$ IF FILESPEC .EQS. "" THEN GOTO LOOPEND
X$ DELTREE [.'F$PARSE(FILESPEC,,,"NAME")']
X$ GOTO LOOP
X$LOOPEND:
X$ IF F$SEARCH("*.*;*") .NES. "" THEN DELETE *.*;*
X$ DIR = ((F$DIRECTORY()-"["-"]")-(F$PARSE("[-]",,,"DIRECTORY")-"["-"]")) -"."
X$ SET PROTECTION=WORLD:RWED [-]'DIR'.DIR;1
X$ DELETE/log [-]'DIR'.DIR;1
X$DONE:
X$ SET DEFAULT 'DEFAULT'
$GoSub Convert_File
$Exit
------

MACALLSTR@vax1.physics.oxford.ac.UK (06/29/88)

The system manager can set up mail forwarding in a variety of ways. For
 example if you want any mail sent to HELP ( which may or may not be a
 real username ) to be sent to MANAGER ( which is a real username ), the
 system manager simply issues the following command within MAIL :


         MAIL> SET FORWARD/USER=HELP MANAGER

John