Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > ming-ruby question

Reply
Thread Tools

ming-ruby question

 
 
George Moschovitis
Guest
Posts: n/a
 
      12-13-2004
Hello everyone,

I would like to capture of Ming-Ruby in a Ruby String/StringIO.
I tried the following w/o success:

tmp = $stdout
flash = $stdout = StringIO.new
m.output
$stdout = tmp

The low level C output methods doesnt understand about
$stdout and keeps dumping bytes to the standard output.
Any ideas?

Thanks in advance for any help.
George.


--
www.navel.gr | tel: +30 2106898050 | fax: +30 2106898437

web appliction engine: http://www.navel.gr/nitro
have fun: http://www.joy.gr
 
Reply With Quote
 
 
 
 
Logan Capaldo
Guest
Posts: n/a
 
      12-13-2004
On Mon, 13 Dec 2004 21:22:19 +0900, George Moschovitis <> wrote:
> Hello everyone,
>
> I would like to capture of Ming-Ruby in a Ruby String/StringIO.
> I tried the following w/o success:
>
> tmp = $stdout
> flash = $stdout = StringIO.new
> m.output
> $stdout = tmp
>
> The low level C output methods doesnt understand about
> $stdout and keeps dumping bytes to the standard output.
> Any ideas?
>
> Thanks in advance for any help.
> George.
>
> --
> www.navel.gr | tel: +30 2106898050 | fax: +30 2106898437
>
> web appliction engine: http://www.navel.gr/nitro
> have fun: http://www.joy.gr
>
>

Well this idea is a hack obviously but have you tried:

# mingout.rb
...
ming.output

# mingin.rb
m = IO:open("mingout.rb")
data = m.read

The massive downside to this is that it requires two programs, and I
am sure there is
a better way, but it should work


 
Reply With Quote
 
 
 
 
George Moschovitis
Guest
Posts: n/a
 
      12-13-2004
Well i dont want 2 programs...
I dont want ot save to a file with m.save('filename') and use File.read
to get
the data either, any other solution?

-g.

 
Reply With Quote
 
Logan Capaldo
Guest
Posts: n/a
 
      12-13-2004
On Tue, 14 Dec 2004 05:37:19 +0900, George Moschovitis
<> wrote:
> Well i dont want 2 programs...
> I dont want ot save to a file with m.save('filename') and use File.read
> to get
> the data either, any other solution?
>
> -g.
>
>

Well I downloaded the ming source, and looked at the code for the
output method. It uses putchar() directly. You'd probably have to
patch the ming source and create a method that could use fputc( ) and
took a FILE* or something similiar (suitably wrapped up in a ruby
object) as an argument. Sorry


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
question row filter (more of sql query question) =?Utf-8?B?YW5kcmV3MDA3?= ASP .Net 2 10-06-2005 01:07 PM
Quick Question - Newby Question =?Utf-8?B?UnlhbiBTbWl0aA==?= ASP .Net 4 02-16-2005 11:59 AM
Question on Transcender Question :-) eddiec MCSE 6 05-20-2004 06:59 AM
Question re: features of the 831 router (also a 924 question) Wayne Cisco 0 03-02-2004 07:57 PM
Syntax Question - Novice Question sean ASP .Net 1 10-20-2003 12:18 PM



Advertisments