$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! $! $! Procedure that runs in batch and: $! $! 1. Checks if any non privileged news items have been submitted. $! 2. Moves any such files to the news directory $! 3. Removes expired news items $! $! Version 2.0 - 08 Aug 1986 - J F Lawrence $! $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! $! $! Resubmit to run tomorrow $! $ @news:submitnews $ set process/priv=bypass $ currdate = f$extract(0,11,f$cvtime(f$time())) $! $! Check for submitals and move any new non-privileged ones to $! the news directory. Also cleanup expired files. $! $dir_loop: $ dirname := 'f$search("news:*.dir",0) $ if dirname .eqs. "" then goto dir_done $ latestsubmittal = "1900-01-01 00:00" $ diroot = - f$trnlnm("newsroot",,"executive") - "]" + f$parse(dirname,,,"name") + "]" $ open/read/write/share=write/error=dir_loop newsdir 'diroot'newsdir.dat $! $loop: $ read/end=loop_done newsdir newsdirdata $ subjlen = f$cvui(56*8,8,newsdirdata) $ fnlen = f$cvui(57*8,8,newsdirdata) $ inputfile = f$extract(58+subjlen,fnlen,newsdirdata) $ if f$search(inputfile) .nes. "" then goto file_exists $ read/delete/key="''f$extract(0,16,newsdirdata)'" newsdir junk $ goto loop $! $file_exists: $ deletefile = inputfile $ root = f$parse(inputfile,,,"device") + f$parse(inputfile,,,"directory") $ if root .eqs. diroot then goto expire_check $ outputfile = diroot + f$search(inputfile) - root $ back/overlay/verify/delete 'inputfile' 'outputfile' $ fnlen = f$length(outputfile) $ newsdirdata[57*8,8] = fnlen $ newsdirdata[58+subjlen,fnlen] := 'outputfile $ write/update newsdir newsdirdata $ deletefile = outputfile $! $expire_check: $ expiredate = f$extract(0,11,f$cvtime(f$extract(33,11,newsdirdata))) $ submitdate = f$extract(0,16,newsdirdata) $ if expiredate .les. currdate then goto delete_file $ latestsubmittal = submitdate $ goto loop $! $delete_file: $ read/delete/key="''f$extract(0,16,newsdirdata)'" newsdir junk $ delete/log 'deletefile' $ goto loop $! $loop_done: $ close newsdir $ if latestsubmittal .eqs. "1900-01-01 00:00" then goto dir_loop $ open/read/write lastnews 'diroot'lastnews.date $ read lastnews junk $ write/update lastnews latestsubmittal $ close lastnews $ goto dir_loop $! $dir_done: $ exit