diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-02-26 14:43:08 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-02-26 14:43:08 -0800 |
commit | b122f037c3af81b8e20deb36b9e0706fe8535668 (patch) | |
tree | 6b29ad2e36aa8b4118917d710529576a23360d80 | |
parent | 5c9dc339b355546e68013be26aa54cc0e9978409 (diff) | |
download | ruby_io_splice-b122f037c3af81b8e20deb36b9e0706fe8535668.tar.gz |
No need to open in binary mode since no file data goes through luserspace!
-rw-r--r-- | lib/io/splice.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/io/splice.rb b/lib/io/splice.rb index af50afc..0e332dd 100644 --- a/lib/io/splice.rb +++ b/lib/io/splice.rb @@ -34,8 +34,8 @@ module IO::Splice # +src+ and +dst+ must be IO objects or respond to +to_io+ def self.copy_stream(src, dst, len = nil, src_offset = nil) close = [] - src.kind_of?(String) and close << (src = File.open(src, 'rb')) - dst.kind_of?(String) and close << (dst = File.open(dst, 'wb')) + src.kind_of?(String) and close << (src = File.open(src)) + dst.kind_of?(String) and close << (dst = File.open(dst, "w")) src, dst = src.to_io, dst.to_io rv = len src.sysseek(src_offset) if src_offset |