[ANN] win32-open3 0.1.0

D

Daniel Berger

Hi all,

We are happy to announce the first release of win32-open3!

What is it?
===========
The Open3 library for Win32, which allows you to use the popen3
method.

This is actually Park Heesob's win32_popen module repackaged. The API
has been altered so that it is identical* to the version currently
distributed in the Ruby standard library.

* Well, it's not quite identical. You can pass an optional second
argument to denote the mode type, either 't' (text) or 'b' (binary).
The default is 'text' mode.

Synopsis
========
require "win32/open3"

cmd = "ver" # or whatever
input, output, error = Open3.popen3(cmd)

input.close # don't need it
err = error.gets # might be nil
if err
puts "Error running command '#{cmd}': " + err.chomp
error.close
output.close
exit
end

# 'ver' actually returns an array of 2 lines (one empty line)
out = output.readlines

puts "Got: " + out.to_s.strip
output.close
error.close

Where is it?
============
You can find it on the project site at
http://www.rubyforge.org/projects/win32utils.

The download link is
http://rubyforge.org/frs/download.php/1663/win32-open3-0.1.0.zip

It can also be found on the RAA (soon - I can't seem to get to it at
the moment to add an entry).

What about open2, open4 and posix_popen?
========================================
These methods are included in Park's win32_popen package, but they
have been removed for the first release of win32-open3. They may be
added back in a later release. The notion of an "Open3.popen4" makes
me wonder if "Open3" was such a good module name after all, but too
late now.

Prerequisites
=============
Ruby 1.8.0 or later
Windows NT family (NT, 2000, XP, etc)

Other notes
===========
This will be in the next release of the Win32Utils installer.

Enjoy!

The Win32Utils Team
 

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

Similar Threads

[ANN] win32-open3 0.2.0 0
[ANN] win32-security 0.1.0 0
[ANN] win32-sapi 0.1.0 3
[ANN] win32-nio 0
[ANN] win32-mutex 0.1.0 0
[ANN] win32-taskscheduler 0.2.0 0
[ANN] win32-dir 0.1.0 5
[ANN] win32-etc 0.1.0 0

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top