From: SourceForge.net <no...@so...> - 2010-03-25 00:46:11
|
Bugs item #2975571, was opened at 2010-03-24 00:21 Message generated for change (Comment added) made by uzinngre You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684730&aid=2975571&group_id=119701 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Platform Interface Group: v4.0 Status: Open Resolution: None Priority: 5 Private: No Submitted By: U. Zinngrebe (uzinngre) Assigned to: Nobody/Anonymous (nobody) Summary: Interpreter does not provide STDIN in pipeline Initial Comment: The old IBM oRexx interpreter could be used as stage in a pipeline (OS/2, Windows 2000/XP, Linux) The ooRexx interpreter seems not to work as stage command, example below (Windows XP, Linux SUSE 11.2) I don't find in the reference/programmer guide whether it is supposed to work. ---------------------------------------------------------------------------------------------------------------- OK as first stage in the pipeline: uli@ulmo:~> rexx test.rex <temp.dat | more HELLO aaa bbb ccc GOODBYE ------------------------------------------------------------------------------- As second stage in the pipeline, STDIN does not receive input: uli@ulmo:~> more <temp.dat | rexx test.rex HELLO GOODBYE ------------------------------------------------------------------------------- test.rex: say hello do while lines() line = linein() call lineout , line -- say line end say goodbye ------------------------------------------------------------------------------- temp.dat: aaa bbb ccc -------------------------------------------------------------------- uli@ulmo:~> rpm -q ooRexx ooRexx-4.1.0-5678.x86_64 uli@ulmo:~> uname -a Linux ulmo 2.6.31.12-0.1-desktop #1 SMP PREEMPT 2010-01-27 08:20:11 +0100 x86_64 x86_64 x86_64 GNU/Linux uli@ulmo:~> rexx -v Open Object Rexx Version 4.1.0 Build date: Mar 9 2010 Addressing Mode: 64 ---------------------------------------------------------------------- Comment By: U. Zinngrebe (uzinngre) Date: 2010-03-25 01:46 Message: chars() has same problem as lines(). Rony gave a workaround. ------------------------------------------------------------------ test.rex: say hello do while stream('STDIN:', 'state')="READY" line = linein() call lineout , line -- say line end say goodbye ------------------------------------------------------------- uli@ulmo:~> more <temp.dat 2>1 | rexx test.rex HELLO aaa bbb ccc GOODBYE ---------------------------------------------------------------------- Comment By: jfaucher (jfaucher) Date: 2010-03-24 14:49 Message: Same problem under windows I can have a good result from lines() by changing that, but not sure it's the good solution (windows only) : Assume that a FIFO is a transient stream : SysFile::getStreamTypeInfo if ((fileInfo.st_mode & _S_IFIFO) != 0) { transient = true; } I had to change that : SysFile::hasData return !atEof(); I think that this change should be done as well : MSDN doc : st_size : If fd refers to a device, the st_atime, st_ctime, st_mtime, and st_size fields are not meaningful. st_dev : If a device, fd; otherwise 0. SysFile::getSize //if ((fileInfo.st_mode & _S_IFREG) != 0) if (fileInfo.st_dev == 0) { size = fileInfo.st_size; ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684730&aid=2975571&group_id=119701 |