Some senseless babbling from Eddy Thilleman to Mike Ruskai
on 09-27-99 21:45 about hstart wget?...
ET> Hello Mike,
ET> 24 Sep 99 13:15, MIKE RUSKAI wrote to EDDY THILLEMAN:
MR> You shouldn't depend on this. Opening files should always be done
MR> with the stream() function (or with a Stream object in OREXX),
ET> I would like to know why.
I explained in another message that it's only a side-effect, not REXX
design (as far as I know).
MR> like this:
MR> check=stream(InFile,'c','open read') if check='' then /* couldn't
MR> open the file, act appropriately */
This is actually wrong. stream() returns 'READY:' or 'ERROR:??' for
opening a file. It's 'query exists' that returns a null string.
ET> So I changed my REXX file into this:
ET> ------------------- begin of wgetmir.cmd -------------------
ET> /* start wget mirroring each website/file listed in wget.mir */
ET> arg InFile
ET> if InFile = '' then
ET> InFile = 'wget.mir'
ET> dir = directory( 'c:\www' )
ET> '@set wgetrc=c:\www\wget.cfg'
ET> cmd1 = 'wget.exe -m -c -np --tries=1 -k '
ET> cmd2 = ' -a '
ET> LogFile = "wget.mir.log"
ET> filler = copies('-',30)
ET> signal on notready
ET> LineNr = 0
ET> check = stream( InFile, 'c', 'open read' )
ET> if check != 'READY' then /* couldn't open the file, act appropriately
ET> */ do
It's 'READY:', not 'READY'. Though in PC-DOS 7's REXX, it is 'READY'. So,
you might want to do this:
if left(check,5) != 'READY' then do
ET> say "Cannot open file" InFile check
ET> ch = SysGetKey( NoEcho )
ET> end
ET> else
ET> do while stream( InFile, 'state' ) = 'READY'
lines() or chars() would be better here.
Mike Ruskai
thannymeister@yahoo.com
... Existence is not only temporary, but also pointless.
___ Blue Wave/QWK v2.20
--- Platinum Xpress/Win/Wildcat5! v3.0pr2
267/200
45
* Origin: FIDO QWK MAIL & MORE! WWW.DOCSPLACE.ORG (1:3603/140)
|