stderr capture on Windows

S

Sard Aukary

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)"
 
A

Anatol Pomozov

Sard said:
Well that gives me another cryptic error

"The handle could not be duplicated during redirection of handle 1" :D

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.
 
B

Bill Kelly

From: "Sard Aukary said:
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
 
S

Sard Aukary

Anatol said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top