C fwrite equivalent in ruby

Hello list

I want to know if there is an equivalent to the C function fwrite in
ruby.
Remeber that fwrite takes a buffer and a size of Bytes to write.

the method “write” of the File object takes only the buffer to write as
a
parameter, but what I want to do is to write only an amount of bytes
from
this buffer, not all the buffer.

Thank you!

On Sep 30, 2008, at 9:09 AM, Lyes A. wrote:

this buffer, not all the buffer.

Thank you!

===========
| Lyes A.
| USTHB, Algiers

io.write buffer[0,len]

a @ http://codeforpeople.com/

On Sep 30, 11:29 am, “ara.t.howard” [email protected] wrote:

io.write buffer[0,len]

or call io.putc(byte) as many times as necessary.

– Mark.

On 30.09.2008 17:43, Mark T. wrote:

On Sep 30, 11:29 am, “ara.t.howard” [email protected] wrote:

io.write buffer[0,len]

One additional remark: String#[] does not copy the internal buffer, so
you do not have to worry about wasting too much memory.

or call io.putc(byte) as many times as necessary.

This is likely inefficient.

Kind regards

robert