codeslinger / sendfile

Ruby interface to sendfile(2) system call

This URL has Read+Write access

codeslinger (author)
Sat Dec 27 10:11:11 -0800 2008
commit  3f5350a3f1e4d4366fd0df36086a2bddff867059
tree    4a8dbaf32ac6e3ac3de4ba92a27df45bc1ba333c
name age message
file ChangeLog Loading commit data...
file FILES
file LICENSE
file README.textile
directory ext/
file sendfile.gemspec
directory test/
README.textile

Ruby sendfile(2) Interface

This module allows Ruby programs to access their OS’s native
`sendfile(2)` system call from any IO object. Your kernel must
export a recognized signature for the `sendfile(2)` system call
to use this module. Currently, that includes Linux, Solaris
and FreeBSD.

Installation

Download and install the latest package from the rubyforge.org
RubyGems repository.

$ sudo gem install sendfile

If the tests all pass, you’re ready to start using sendfile.

Usage

Here’s a small example of a use of `IO#sendfile`.

require ‘socket’ require ‘rubygems’ require ‘sendfile’ s = TCPSocket.new ‘yourdomain.com’, 5000 File.open ‘somefile.txt’ { |f| s.sendfile f } s.close

See the test scripts for more examples on how to use this
module.