tldm-universe/Ardent/UV/APP.PROGS/DEACTLIST.B
2024-09-09 17:51:08 -04:00

137 lines
3.4 KiB
Brainfuck
Executable File

*******************************************************************************
*
* Deactivate files from select list
*
* 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.
* 09/11/97 21464 NDP Removed superfluous double-quoting of command
* arguments for log_main; this caused problems for
* multi-byte filenames.
* 08/30/96 19125 DTM Fixed problem with quotation marks
* 06/12/96 18438 JC Port to NT
* 03/25/96 18212 LAG Windows NT port
* 02/09/93 11033 CSM Process file names containing $
* 01/19/93 10886 CSM Detect missing/incorrect UV.TRANS index
* 01/18/93 10886 CSM Initial Creation
*
*******************************************************************************
$OPTIONS DEFAULT
$INCLUDE UNIVERSE.INCLUDE OSDEF.H
$INCLUDE UNIVERSE.INCLUDE FILENAMES.H
$INCLUDE UNIVERSE.INCLUDE MACHINE.NAME
******************
** Windows NT port
**
DEFFUN IS.EQPATHS(FILESPEC.A, FILESPEC.B) CALLING "*IS.EQPATHS"
**
******************
!
* Check that we are within uniVerse home directory
!
******************
** Windows NT port
**
if not(IS.EQPATHS(@PATH, UV.ROOT)) then
print "You must be within the uniVerse home account to run this program!"
stop
END
**
******************
$IFDEF UV.MSWIN
if SYSTEM(27) # 0 then stop "You must be an administrator to run this program!"
$ELSE
if SYSTEM(27) # 0 then stop "You must be root to run this program!"
$ENDIF
!
* Get command line
!
CommandLine = convert(" ",@fm,@sentence)
locate "DEACTLIST" in CommandLine setting POS then
* Get rid of everything up to and including program name
for i = 1 to POS
del CommandLine<1>
next i
end
!
* Make certain enough arguments
!
NumArgs = dcount(CommandLine,@fm)
if NumArgs # 1 then
print "Incorrect Number of arguments"
print
print "Syntax: DEACTLIST listname"
print
stop
end
ListName = CommandLine<1>
!
* Make certain ListName name does exist
!
getlist ListName to 1 else
print
print "List '":ListName:"' does NOT exist!"
stop
end
!
* Check that UV.TRANS has a current Index
!
open "UV.TRANS" TO uvtrans then
IndexStatus = indices(uvtrans,"FILE")
if IndexStatus<1,1> <> "D" then
print "UV.TRANS must have an Index!"
stop
end
if IndexStatus<1,2> = "1" then
print "Index of UV.TRANS must be rebuilt!"
stop
end
end else stop "Unable to open UV.TRANS file!"
!
* Read through list
!
eof = 0
loop
readnext aline from 1 else eof = 1
until eof do
* Skip files that begin with ampersand &
if aline[1,1] = "&" then continue
* Deactivate DATA portion of file
cmd = OS.EXEC:" '":UV.ROOT:"/bin/log_main 11 "
cmd:= field(aline,":",1):" 0 ":field(aline,":",2):" '"
execute cmd
* Deactivate DICT portion of file
cmd = OS.EXEC:" '":UV.ROOT:"/bin/log_main 11 "
cmd:= field(aline,":",1):" 1 DICT ":field(aline,":",2):" '"
execute cmd
repeat
!
* end of code
!
stop
end