home *** CD-ROM | disk | FTP | other *** search
- /* rh.pass1.rexx, (c) 1993 by Gerald Malitz <gm@germal.escape.de> */
- /* rh.pass1.rexx, chngs (c) 1993 by Kai 'wusel' Siering <wusel@hactar.hanse.de> */
-
- /*
- date = 252460800+days*86400+mins*60+ticks/50
- */
-
- if ~show('L', "rexxsupport.library") then do
- if ~addlib("rexxsupport.library", 0, -30, 0)
- then exit 10
- end
-
- /* wusel, Thu, 8 Jul 1993 16:38:24 +0200:
- *
- * first get all expired articles out of uulib:news/history
- */
- if open(histfile, "uulib:news/history", 'R') then do
- do forever
- line = readln(histfile)
- if eof(histfile) then leave
-
- parse value line with msgid '09'x date '09'x files
-
- if(files=="")
- then say date ||'09'x|| msgid ||'09'x|| files
- end
- close(histfile)
- end
-
- /* Perform the scan, rebuilding the history.
- * NOTE: for sorting purposes date & id are reversed, corrected
- * with rh.pass2.rexx.
- */
-
- do forever
- parse pull filename
- if eof(stdin) then leave
-
- parse value statef(filename) with typ . . . days mins ticks .
- if typ ~= "FILE" then iterate
-
- if ~open(infile, filename, 'R') then iterate
-
- date = 252460800+days*86400+mins*60+ticks/50
-
- name = substr(filename, lastpos(':', filename)+1)
- pos = lastpos('/', name)
- name = translate(left(name, pos-1), '.', '/') || substr(name, pos)
-
- msgid = ""
- xref = ""
- expires = "-"
- do forever
- line = readln(infile)
- if eof(infile) | line == "" then leave
- pos = pos(':', line)
- if pos = 0 then iterate
- field = upper(left(line, pos-1))
- if field = "MESSAGE-ID"
- then msgid = strip(substr(line, pos+1))
- if field = "XREF"
- then xref = strip(substr(line, pos+1))
- if field = "EXPIRES"
- then expires = strip(substr(line, pos+1))
- end
- close(infile)
-
- if xref ~= "" then do
- xref = translate(xref,รก'/', ':')
- parse var xref . first xref
- if first ~= name then iterate
- end
-
- say date ||"~"|| expires ||'09'x|| msgid ||'09'x|| name || xref
- end
-
- exit 0
-