Rick
With the current fix for pipes, we don't catch all the datas sent by the
writer below.
But i don't know if it's a bug or a feature...
Indeed, lines() and char() returns 0 when the transient stream has no more
data. It doesn't call _read, and thus has no chance to see new incoming
datas.
The workaround of Rony :
stream('STDIN:', 'state')="READY"
is ok because the test is made on the stream status which is updated by the
read method.
Should we modify SysFile::hasData to call read before testing atEof ? By
passing len=-1, it should be possible to fill the buffer (if needed) without
changing the read position...
But there is a risk to block the caller, and this is not what is expected
for lines() and chars().
test
----
rexx write_stdin.rex | rexx read_stdin.rex
write_stdin.rex
---------------
do i=1 to 10
say "value =" i
call syssleep 0.1
end
read_stdin.rex
--------------
do while lines()
line=linein()
say "Through rexx :" line
end
say "end reading..."
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel