标签:
常规处理:
File.open("sampel.txt") do |file| file.each_line do |line| print line end end
file = File.open("sample.txt") begin file.each_line do |line| print line end ensure file.close end
Ruby文件操作
原文地址:http://www.cnblogs.com/liuyang92/p/5898243.html