Welcome to the Monastery | |
PerlMonks |
Re: Perl ignores lines with bold characters from a pipe on Windowsby almut (Canon) |
on Mar 03, 2007 at 04:25 UTC ( [id://603025]=note: print w/replies, xml ) | Need Help?? |
Just a wild guess: your mycmd might be mixing output via redirectable streams with "direct" console output via WriteConsole. AFAIK, the latter would typically be used to render highlighted text etc., making use of console "attributes". In particular, note that Both WriteConsole and WriteFile can be used for console I/O. While WriteConsole supports writing Unicode characters to a console screen buffer, WriteFile does not. However, WriteConsole fails if it is used with a standard handle that is redirected to a file. (... more) (emphasis added) This might explain why some lines get lost when capturing redirectable output only (stdout). As to why the console output does end up in the file test_shell when redirecting output from the shell command line, I don't know. Maybe some additional magic is going on in this case...(?) Anyway, what kind of program is this? Do you have the sources? If not, you might try a tool like StraceNT to find out what API calls are being used... (in particular look for WriteConsole, WriteFile, etc.)
In Section
Seekers of Perl Wisdom
|
|