新手问题 open-uri 的 open 方法中的 “wb” 什么意思,请指点

autumnwolf · November 29, 2012 · Last by autumnwolf replied at November 29, 2012 · 5955 hits

如下:

open("file_to_write.txt", "wb") do |file|
  open("http://www.ruby-lang.org/") do |uri|
     file.write(uri.read)
  end
end

write & binary

oh i c. 谢谢,找了半天没找到点子上!

#3 楼 @artone 谢谢啦 好惭愧,都没想到去文档查~

You need to Sign in before reply, if you don't have an account, please Sign up first.