Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Ruby Vectored I/O

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 bench
Octocat-spinner-32 ext
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README
Octocat-spinner-32 Rakefile
Octocat-spinner-32 vio.gemspec
Vectored I/O for Ruby MRI
  (c) 2009 Lourens Naudé (methodmissing)

Vectored I/O ?

  POSIX 1003.1-2001 introduces reading or writing data into multiple buffers with a single procedure call.See for an overview.

Use cases :

  * Write non-sequentially placed data in memory to disk with a single write operation.This fits very well with custom database/record formats for writing out indexes and data at once.
  * Reducing syscall overheads
  * Reading structured data (protocol dumps,db records) into distinct buffers

Examples :


  >>io ='/path/to/fix.txt')) 
  => #<File://path/to/fix.txt>
  >>, 5, 5, 6, 8, 26, 8) 
  => ["8=FIX.4.4","\x019=45", "\x0135=0", "\x0149=TW", "\x0156=ISLD",
"\x0134=3\x0152=20000426-12:05:06", "\x0110=220\x01"]    


  sudo gem install methodmissing-vio

Todo :

  * Error handling for rewind + sockets don't support lseek

To run the test suite:


To run the benchmarks:

  rake bench
Something went wrong with that request. Please try again.