freeride-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [FR-devel] Re: [ANN] win32_popen 0.1


From: Richard Kilmer
Subject: Re: [FR-devel] Re: [ANN] win32_popen 0.1
Date: Tue, 31 Dec 2002 22:20:45 -0500

Well, just to let the team know I tried to work this into the script_runner plugin and it does work but locks up all of Ruby when blocking for IO (stdout) read. Kinda weird. Anyway, I did do it before 2003, but I don't want to check it in yet because it does not give us what we need yet on win32...but I will work with Park to make it so (hopefully ;-).

Happy New Year all and here's to 2003...the year FreeRIDE will show the world a thing or two about what can be done with an IDE :-) Oh, and the Project Manager infrastructure is coming along well...after we release 0.5.0 and resolve most of those nagging bugs, I will commit it.

Regards,

Rich

On Tuesday, December 31, 2002, at 09:40 AM, Richard Kilmer wrote:

Bless you....seriously!

This will be integrated into FreeRIDE before 2003 ;-)

-rich

On Tuesday, December 31, 2002, at 02:01 AM, Park Heesob wrote:

Hi, all.

win32_popen is popen2,popen3,popen4 implementation on Windows adapted from
Python source code.

You can use win32_popen3 like this:

require 'win32_popen'

fin,fout,ferr = IO.win32_popen3("date")
puts fout.gets
fin.print "2002-01-01\n"
while !fout.eof
puts fout.gets
end

fin,fout,ferr = IO.win32_popen3("irb")

begin
a = fout.getc
putc a.chr
end while a != ?>

fin.print "exit\n"

while !fout.eof
puts fout.gets
end


You can download mswin binary for your Ruby version.
http://home.nownuri.net/~phasis/popen/win32_popen_1.6.8.zip
http://home.nownuri.net/~phasis/popen/win32_popen_1.8.0.zip
Souce code and binary included.

[Requirement]

* Ruby 1.6.5+

It may be made with other version but not verified.

[Install binary]

ruby install.rb

[Install from source]

ruby extconf.rb
nmake
ruby install.rb

[methods]

IO#win32_popen2(cmd[, mode])
Executes cmd as a sub-process. Returns the file objects (child_stdin,
child_stdout).

IO#win32_popen3(cmd[, mode])
Executes cmd as a sub-process. Returns the file objects (child_stdin,
child_stdout, child_stderr).

IO#win32_popen4(cmd[, mode]])
Executes cmd as a sub-process. Returns the file objects (child_stdin,
child_stdout_and_stderr).

Regards.

Park Heesob








_______________________________________________
Freeride-devel mailing list
address@hidden
http://mail.nongnu.org/mailman/listinfo/freeride-devel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]