标签:nbsp read ruby bsp open ext 读取文件 close puts
Ruby 读取文件
一次全读出来
textAll = File.read("fileName.txt")
puts textAll
一次读取一行
file = File.open("fileName.txt")
file.each_line {|line|
puts line
}
file.close
标签:nbsp read ruby bsp open ext 读取文件 close puts
原文地址:http://www.cnblogs.com/stono/p/6666077.html