#1243 Windows XP Redirecting stdout to a Rexx script not working

None
wont-fix
nobody
None
none
1
2014-08-23
2014-02-07
No

Running a pipe where the standard output should be used as standard input from a Rexx script does not work on Windows XP:

  /* test2.rex
     - run under Windows "dir | test2.rex"
  */
  parse version v; say v

  -- o=.input
  o=.stdin
  maxLoop=10
  say "---> ---> processing (start) --->"
  loop i=1 for maxLoop while o~chars>0
     say "i="i "/ o~chars:" o~chars "/ o~lines:" o~lines
     line=o~linein
     say "["line"]" "length:" line~length
  end
  say "<--- <--- processing (start) <---"

Executing "dir | test2.rex" from a command line yields:

  REXX-ooRexx_4.2.0(MT)_32-bit 6.04 30 Jan 2014
  ---> ---> processing (start) --->
  i=1 / o~chars: 9146447488956947228 / o~lines: 0
  [] length: 0
  i=2 / o~chars: 9146481505097931548 / o~lines: 0
  [] length: 0
  i=3 / o~chars: 9146514937123363612 / o~lines: 0
  [] length: 0
  i=4 / o~chars: 9146548369148795676 / o~lines: 0
  [] length: 0
  i=5 / o~chars: 9146581801174227740 / o~lines: 0
  [] length: 0
  i=6 / o~chars: 9146615233199659804 / o~lines: 0
  [] length: 0
  i=7 / o~chars: 9146648665225091868 / o~lines: 0
  [] length: 0
  i=8 / o~chars: 9146682097250523932 / o~lines: 0
  [] length: 0
  i=9 / o~chars: 9146715529275955996 / o~lines: 0
  [] length: 0
  i=10 / o~chars: 9146748995661126428 / o~lines: 0
  [] length: 0
  <--- <--- processing (start

Doing the "dir" standalone will give in my environment:

  G:\tmp\miscorx>dir
   Datenträger in Laufwerk G: ist root_g
   Volumeseriennummer: 5E48-AF40

   Verzeichnis von G:\tmp\miscorx

  07.02.2014  12:28    <DIR>          .
  07.02.2014  12:28    <DIR>          ..
  07.02.2014  12:28               266 test.rex
  07.02.2014  12:40               358 test2.rex
                 2 Datei(en)            624 Bytes
                 2 Verzeichnis(se), 15.786.868.736 Bytes frei

AFAIK redirecting this way (via the operating system into a Rexx script) should work, such that one can create Rexx scripts that act as regular filters/pipe stages for Unix and Windows pipes (where the Rexx script processes data from stdin and writes to stdout) ?

This is with RC2 of ooRexx 4.2.0 running under Windows XP.

Discussion

  • Rick McGuire
    Rick McGuire
    2014-02-07

    There seems to be something strange going on with the command shell if the invocation of the rexx program is done via the association rather than explicitly using the rexx command. If you use "dir | rexx test2.rex" everything works fine. Not sure this is fixable, since all of the redirection setup is done in the command shell.

     
  • Just another data point to stress that it is probably a Windows-only problem: running the same Rexx program on RC2 64-bit on Ubuntu (with the hashbang line added) works as intended. (No need to prepend "rexx" to the rexx script on that platform.)

     
  • Erich
    Erich
    2014-04-15

    Above works for me on Windows 7, but the following MS Knowledge Base article seems to describe this problem:
    http://support.microsoft.com/default.aspx?scid=kb;en-us;321788

    Maybe you could test and let us know if the suggested fix works for you.

     
  • Rick McGuire
    Rick McGuire
    2014-04-15

    • status: open --> wont-fix
     
  • Rick McGuire
    Rick McGuire
    2014-04-15

    As noted, this problem is with Windows and beyond the scope of what's fixable in ooRexx.

     
  • Rick McGuire
    Rick McGuire
    2014-04-15

    • Group: v4.2.0 --> None
     


Anonymous


Cancel   Add attachments