tldm-universe/Ardent/UV/APP.PROGS/DEL.RFILE.B

86 lines
2.2 KiB
Plaintext
Raw Permalink Normal View History

2024-09-09 21:51:08 +00:00
******************************************************************************
*
* System Admin Transaction Logging - Create Log DIrectory
*
* Module %M% Version %I% Date %H%
*
* (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved
* This is unpublished proprietary source code of Ardent Software Inc.
* The copyright notice above does not evidence any actual or intended
* publication of such source code.
*
*******************************************************************************
*
* Maintenence log - insert most recent change descriptions at top
*
* Date.... GTAR# WHO Description........................................
* 10/14/98 23801 SAP Change copyrights.
* 05/22/96 18438 JC Correct execute for NT.
* 03/25/96 18212 LAG Windows NT port
* 10/14/94 15104 DTM Fixed to verify number of prompts
* 05/15/94 13286 DTM Initial programming
*
*******************************************************************************
id = "%W%"
*******************************************************************************
$INCLUDE UNIVERSE.INCLUDE TLOG.H
$INCLUDE UNIVERSE.INCLUDE MACHINE.NAME
TMP = TRIM( @SENTENCE )
CNT = COUNT( TMP, " " )
IF ( CNT < 2 OR CNT > 3 ) THEN
PRINT 'Error: Incorrect Number of arguments'
STOP
END
FirstLog = FIELD( TMP, " ", 2 )
LastLog = FIELD( TMP, " ", 3 )
PATH = ""
PATH = FIELD( TMP, " ", 4 )
IF PATH = "" THEN
RECIO( PATH, RECIO$PATH )
END
OPEN '',"UV_LOGS" TO uv.log.fp ELSE
PRINT "Cannot Open UV_LOGS file"
STOP
END
******************
** Windows NT port
**
PATH = CONVERT("\", "/", PATH)
IF PATH[1] NE "/" THEN PATH:= "/"
FOR count = FirstLog TO LastLog
File = PATH:"lg":count
READ rec FROM uv.log.fp, count THEN
IF rec<AIF.STATUS> NE "R" THEN
PRINT "Log File Number ":count:"'s status is incompatible for operation."
PRINT "Cannot delete files ":FirstLog:" through ":LastLog
STOP
END
END
ELSE
PRINT "Log File Number ":count:" does not exist"
STOP
END
Exec.Sentence = OS.EXEC:" '":RM.CMD:" -f ":File:"'"
EXECUTE Exec.Sentence CAPTURING junk
IF LEN(junk) EQ 0 THEN
PRINT "File ":File:" has been removed"
END
ELSE
PRINT junk
END
NEXT count
**
******************
END