ruby 读写图片文件

 

# -*- coding: utf-8 -*-


f=File.open('t.jpg','rb').read


File.open('out.jpg','wb') << f


f.close

 

 

#花了一个晚上才弄出来...关键是rb和wb!...想哭呀

你可能感兴趣的:(Ruby-Rails)