home *** CD-ROM | disk | FTP | other *** search
/ back2roots/padua / padua.7z / padua / uucp / wCNews_1.0.30.lha / contrib / RebuildHistory / POSTER / text0000.txt / rh.lha / rh.pass1.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1993-03-22  |  1.2 KB  |  53 lines

  1. /*
  2.     date = 252460800+days*86400+mins*60+ticks/50
  3. */
  4.  
  5. if ~show('L', "rexxsupport.library") then do
  6.     if ~addlib("rexxsupport.library", 0, -30, 0)
  7.         then exit 10
  8. end
  9.  
  10. do forever
  11.     parse pull filename
  12.     if eof(stdin) then leave
  13.  
  14.     parse value statef(filename) with typ . . . days mins ticks .
  15.     if typ ~= "FILE" then iterate
  16.  
  17.     if ~open(infile, filename, 'R') then iterate
  18.  
  19.     date = 252460800+days*86400+mins*60+ticks/50
  20.  
  21.     name = substr(filename, lastpos(':', filename)+1)
  22.     pos = lastpos('/', name)
  23.     name = translate(left(name, pos-1), '.', '/') || substr(name, pos)
  24.  
  25.     msgid = ""
  26.     xref = ""
  27.     expires = "-"
  28.     do forever
  29.         line = readln(infile)
  30.         if eof(infile) | line == "" then leave
  31.         pos = pos(':', line)
  32.         if pos = 0 then iterate
  33.         field = upper(left(line, pos-1))
  34.         if field = "MESSAGE-ID"
  35.             then msgid = strip(substr(line, pos+1))
  36.         if field = "XREF"
  37.             then xref = strip(substr(line, pos+1))
  38.         if field = "EXPIRES"
  39.             then expires = strip(substr(line, pos+1))
  40.     end
  41.     close(infile)
  42.  
  43.     if xref ~= "" then do
  44.         xref = translate(xref,รก'/', ':')
  45.         parse var xref . first xref
  46.         if first ~= name then iterate
  47.     end
  48.  
  49.     say date ||"~"|| expires ||'09'x|| msgid ||'09'x|| name || xref
  50. end
  51.  
  52. exit 0
  53.