Is it possible to capture stderr on Windows?
Backtick seems to ignore it, and
require "open3"
stdin, stdout, stderr = Open3.popen3('dir')
gives me
"the fork() function is unimplemented on this machine
(NotImplementedError)"
···
--
Posted via http://www.ruby-forum.com/.
Sard Aukary wrote:
Is it possible to capture stderr on Windows?
Backtick seems to ignore it, and
require "open3"
stdin, stdout, stderr = Open3.popen3('dir')
gives me
"the fork() function is unimplemented on this machine
(NotImplementedError)"
See solution here
http://blog.pomozov.info/posts/capturing-stderr-on-ruby.html
···
--
Posted via http://www.ruby-forum.com/\.
Is it possible to capture stderr on Windows?
Backtick seems to ignore it, and
require "open3"
stdin, stdout, stderr = Open3.popen3('dir')
gives me
"the fork() function is unimplemented on this machine (NotImplementedError)"
http://popen4.rubyforge.org/
or
gem install POpen4
It should present several possible versions to install. If your
windows ruby was installed using the 1.8.4 one-click installer,
you probably want the "win32-1.8.4-VC6" version.
Regards,
Bill
···
From: "Sard Aukary" <sardaukary@yahoo.co.uk>
Anatol Pomozov wrote:
See solution here
http://blog.pomozov.info/posts/capturing-stderr-on-ruby.html
Well that gives me another cryptic error
"The handle could not be duplicated during redirection of handle 1" ![:smiley: :smiley:](https://emoji.discourse-cdn.com/twitter/smiley.png?v=12)
···
--
Posted via http://www.ruby-forum.com/\.
Sard Aukary wrote:
Anatol Pomozov wrote:
See solution here
http://blog.pomozov.info/posts/capturing-stderr-on-ruby.html
Well that gives me another cryptic error
"The handle could not be duplicated during redirection of handle 1" ![:smiley: :smiley:](https://emoji.discourse-cdn.com/twitter/smiley.png?v=12)
Try to put following line to separate script and run
puts `dir 2>&1`
what do you see?
If everything is OK then problem in you main script. Try to check that
you do not copy or replace STDOUT.
···
--
Posted via http://www.ruby-forum.com/\.
Anatol Pomozov wrote:
puts `dir 2>&1`
what do you see?
If everything is OK then problem in you main script. Try to check that
you do not copy or replace STDOUT.
Yes it was my script that works now.
Thanks for the help.
···
--
Posted via http://www.ruby-forum.com/\.