TIP: Click on subject to list as thread! ANSI
echo: os2rexx
to: John Clarke
from: Eddy Thilleman
date: 1999-09-28 21:07:22
subject: hstart wget?

Hello John,

25 Sep 99 09:02, John Clarke wrote to Eddy Thilleman:

JC> The only improvement I would like would be the ability queue the
JC> 'icons' if I have several filelist.lst URL files.

I put the URL for what I want to get from the internet in a textfile which is
read by my batch- and REXX files which will start wget to get what is listed
in that textfile.

JC> If you get your rexx script working would you please send me a copy?
JC> I'll see if I can add the queue processing.

I've revised my REXX file:

------------------- begin of wgetmir.cmd -------------------
/* start wget mirroring each website/file listed in wget.mir */
arg InFile

if InFile = '' then
  InFile = 'wget.mir'

dir = directory( 'c:\www' )
'@set wgetrc=c:\www\wget.cfg'

cmd1 = 'wget.exe -m -c -np --tries=1 -k '
LogFile = "wget.mir.log"
ErrorFile = "rexx.error"
filler = copies('-',30)

signal on notready

LineNr = 0

check = stream( InFile, 'c', 'open read' )
if check = 'READY:' then
  do while stream( InFile, 'state' ) = 'READY'
    Line = LineIn( InFile )
    if strip( Line ) = '' then  /* if Line not empty */
    do
      LineNr = LineNr + 1
      LogFile = "wget.mir"LineNr".log"
      say LineNr': 'Line
      cmd = cmd1 || Line || ' -a ' || LogFile
      check   = stream( LogFile, 'C', 'open write' )    /* open logfile */
      check   = stream( LogFile, 'C', 'seek <' 0 )      /* seek to end of
logfile */
      written = LineOut( LogFile, filler date('W') date() Time() filler )  /*
append day date time to logfile */
      check   = stream( LogFile, 'C', 'close' )         /* close logfile so
wget can use it */
      "@start /win /c /b" cmd
    end  /* if Line not empty */
  end
else  /* couldn't open the file */
  do  /* --- begin of untested code --- */
    errmsg  = stream( InFile, 'D' )     /* ask description about possible
error */
    check   = stream( ErrorFile, 'C', 'open write' )    /* open errorfile */
    check   = stream( ErrorFile, 'C', 'seek <' 0 )      /* seek to end of
errorfile */
    written = LineOut( ErrorFile, date('W') date() Time() "Cannot open file"
InFile errmsg )
    check   = stream( ErrorFile, 'C', 'close' )
  end  /* --- end of untested code --- */

check = stream( InFile, 'C', 'close' )

return

NotReady:
  if LineNr = 0 then
    say 'NotReady' InFile

return
-------------------- end of wgetmir.cmd --------------------

  Greetings   -=Eddy=-        email: eddy.thilleman@net.hcc.nl

... Windows NT: Neanderthaler Technology
--- GoldED/2 3.0.1
2433/225
* Origin: Windows98 is a graphic DOS extender (2:500/143.7)

SOURCE: echoes via The OS/2 BBS

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.