headerloop = @fragments.enum_for(:each_with_index).collect { |f, i| [b::Uint32be, f.id, b::Uint32be, offset((f.content.size) ,i)]}.flatten  

#Then calculating the offset outside that block
...

Ruby On Creating a binary file with...

by podcaster, March 11, 2010 13:18

I managed to fix the offset...

13d7a3ab12ec57e0d372d7115362cb91 Talk

Ruby On Creating a binary file with...

by podcaster, March 11, 2010 07:38

Hi, thanks so much for the ...

13d7a3ab12ec57e0d372d7115362cb91 Talk
File.open( "binary.bin", "wb" ) do |io|
  obj = BinData::String.new(:initial_value => "Binary file start-point").write(io)      
  obj = BinData::Uint32be.new(:initial_value => 0).write(io)
...

Ruby Creating a binary file with...

by podcaster, March 01, 2010 12:14, 3 refactorings, tagged with ruby, io, binary, bindata

Hi, I'm currently using Bin...

13d7a3ab12ec57e0d372d7115362cb91 Talk