about summary refs log tree commit homepage
path: root/lib/mogilefs/mogilefs.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-11-02 23:20:58 +0000
committerEric Wong <normalperson@yhbt.net>2011-11-02 23:20:58 +0000
commit93242dbc664409e8bd78f021ba7b527f340fa1d7 (patch)
tree488c4c8d3ca981a5cfd6322a4fea7c678ad5c5d4 /lib/mogilefs/mogilefs.rb
parentc5bb0bffe17e7fa924fcca2f5dc85271ac466cea (diff)
downloadmogilefs-client-93242dbc664409e8bd78f021ba7b527f340fa1d7.tar.gz
We're trying to use as much as we can from Ruby 1.9
Diffstat (limited to 'lib/mogilefs/mogilefs.rb')
-rw-r--r--lib/mogilefs/mogilefs.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/mogilefs/mogilefs.rb b/lib/mogilefs/mogilefs.rb
index 6c4220b..f064d43 100644
--- a/lib/mogilefs/mogilefs.rb
+++ b/lib/mogilefs/mogilefs.rb
@@ -139,15 +139,15 @@ class MogileFS::MogileFS < MogileFS::Client
     raise MogileFS::ReadOnlyError if readonly?
 
     new_file key, klass do |mfp|
-      if file.respond_to? :sysread then
-        sysrwloop(file, mfp)
+      if file.respond_to?(:read)
+        copy_stream(file, mfp)
       else
         size = File.size(file)
         if size > 0x10000 # Bigass file, handle differently
           mfp.big_io = file
           size
         else
-          File.open(file, "rb") { |fp| sysrwloop(fp, mfp) }
+          File.open(file, "rb") { |fp| copy_stream(fp, mfp) }
         end
       end
     end