****************************************************************************** * * Transaction Logging Routine to Create a Raw 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. * 06/26/98 23161 RGA Raw Device support * ******************************************************************************* id = "%W%" ******************************************************************************* $INCLUDE UNIVERSE.INCLUDE MTF.INCL.H $INCLUDE UNIVERSE.INCLUDE TLOG.H $INCLUDE UNIVERSE.INCLUDE FILENAMES.H $INCLUDE UNIVERSE.INCLUDE MACHINE.NAME * Equate tokens for return values for sysadmin option EQU LDIR$BADPATH TO "1" EQU LDIR$BADRAWDEV TO "2" ****************** ** Windows NT port ** DEFFUN GET.DIRNAME(FILESPEC) CALLING "*GET.DIRNAME" ** ****************** temp = "" CALL *ISUSER.B(0, temp) IF temp = 0 THEN TPRINT UVREADMSG(071000,"") SLEEP 3 STOP END State ="" RECIO( State, FINFO$AI.STATE, RECIO$FINFO ) IF State = AI$INITIAL OR State = AI$WARM.START OR State = AI$LOGGING OR State = AI$SUSPENDED OR State = AI$SUSP.PROG OR State = AI$SHUT.PROG THEN PRINT "Cannot Create Logging Directory... Logging must be SHUTDOWN" STOP END IF State = AI$FULL THEN Cpt = "" RECIO( Cpt, FINFO$AI.CHECKPOINT, RECIO$FINFO ) IF Cpt = 1 THEN PRINT "Cannot Create Logging Directory... Logging must be SHUTDOWN" STOP END END File.Name = FIELD( @SENTENCE, " ", 2 ) ;* get file name from command line Option = FIELD( @SENTENCE, " ", 3 ) ;* see if we are from SysAdm IF Option = "" THEN Option = 0 END ;* First, open file OPEN "DICT", LOGS.FILE to Log.File ELSE ;* open D_UV_LOGS files PRINT ERR.OPEN.D STOP END ;* Second, make sure the raw device exists Exec.uvfile = OS.EXEC:" '":UV.BIN:"/UVfile ":File.Name:"'" EXECUTE Exec.uvfile CAPTURING trashcan IF NOT(INDEX(trashcan, ": rawdevice", 1)) THEN IF Option = 0 THEN PRINT ERR.DIR:File.Name:")" path = GET.DIRNAME(File.Name) PRINT "Path (":path:") not found" END ELSE ;* called from sysadmin PRINT LDIR$BADRAWDEV END GOTO EXIT END REC = "" ;* initialize dynamic array REC<1> = "X" REC<2> = File.Name ;* Ok, now update record WRITE REC ON Log.File, LOGS.RAWDIR ELSE PRINT ERR.WRITE.D GOTO EXIT END EXIT: CLOSE Log.File END