diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-02-07 17:22:19 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-02-07 17:22:19 -0800 |
commit | cdc5fc07a34bd17f2162dcb171928f49af55ead7 (patch) | |
tree | 1447af491b2e28f21a631c202cf6507c6a5df64d /lib/mogilefs/mogilefs.rb | |
parent | ffc4ec4baaae5020c98dc545c6c6ade0336a3311 (diff) | |
download | mogilefs-client-cdc5fc07a34bd17f2162dcb171928f49af55ead7.tar.gz |
File and StringIO objects need to be opened in binary mode, otherwise they take the default encoding format. Thankfully, Sockets and Tempfile objects seem to be binary by default as of 1.9.1; but it really is a mess to have to deal with FS abstractions that try to deal with encoding crap behind your back...
Diffstat (limited to 'lib/mogilefs/mogilefs.rb')
-rw-r--r-- | lib/mogilefs/mogilefs.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/mogilefs/mogilefs.rb b/lib/mogilefs/mogilefs.rb index e2ee1ee..f95cb1c 100644 --- a/lib/mogilefs/mogilefs.rb +++ b/lib/mogilefs/mogilefs.rb @@ -148,7 +148,7 @@ class MogileFS::MogileFS < MogileFS::Client mfp.big_io = file return else - return File.open(file) { |fp| sysrwloop(fp, mfp) } + return File.open(file, "rb") { |fp| sysrwloop(fp, mfp) } end end end |