In Files

Parent

Class/Module Index

IO::Splice

Public Class Methods

copy_stream(src, dst, len = nil, src_offset = nil) view method source

copies the contents of the IO object given by src to dst If len is specified, then only len bytes are copied and EOFError is raised if fewer than len bytes could be copied. Otherwise the copy will be until EOF is reached on the src. src and dst must be IO objects or respond to to_io

This is nearly a drop-in replacement for IO.copy_stream (in Ruby 1.9) but does not take into account userspace I/O buffers nor IO-like objects with no underlying file descriptor (e.g. StringIO).

full(src, dst, len, src_offset) view method source

splice the full amount specified from src to dst Either dst or src must be a pipe. dst and src may BOTH be pipes in Linux 2.6.31 or later. This will block and wait for IO completion of len Raises EOFError if end of file is reached. bytes. Returns the number of bytes actually spliced (always len) unless src does not have len bytes to read.

Do not use this method to splice a socket src into a pipe dst unless there is another process or native thread doing a blocking read on the other end of the dst pipe.

This method is safe for splicing a pipe src into any type of dst IO.

partial(src, dst, len, src_offset) view method source

splice up to len bytes from src to dst. Either dst or src must be a pipe. dst and src may BOTH be pipes in Linux 2.6.31 or later. Returns the number of bytes actually spliced. Like IO#readpartial, this never returns Errno::EAGAIN

Originally generated with the Darkfish Rdoc Generator 2, modified by wrongdoc.