home *** CD-ROM | disk | FTP | other *** search
/ YPA: Your Privacy Assured / YPA.ISO / other_goodies / utilities / iu-14-as225.lha / INetUtils-1.4 / contrib / active2next.rexx next >
OS/2 REXX Batch file  |  1994-09-30  |  814b  |  34 lines

  1. /*
  2.  * A quad hack to read an active file, and update the uunews: tree
  3.  * with .next files that match it.
  4.  *
  5.  * Thanks to Mike Meyer (mwm@contessa.phone.net)
  6.  */
  7.  
  8. parse arg activefile
  9.  
  10. /* Verify we've got something to work with */
  11. if activefile = "" then do
  12.     say "usage: active2next <activefile>"
  13.     exit 10
  14.     end
  15.  
  16. /* Go fetch stuff via nntp */
  17. address command 'nntpxfer' '$NNTPSERVER' activefile 'paranoid'
  18.  
  19. /* Get the file to process */
  20. if ~open(active, activefile, 'Read') then do
  21.     say "No active file!? Fix this, and try again!"
  22.     exit 10
  23.     end
  24.  
  25. /* Now do it, one line at a time */
  26. do while ~eof(active)
  27.     parse value readln(active) with group hi . .
  28.     if hi = "" then iterate
  29.     group = translate(group, "/", ".")
  30.     dir = 'uunews:'group
  31.     if ~exists(dir) then iterate
  32.     address command 'echo' (hi + 1) '>'dir'/.next'
  33.     end
  34.