0
使用下面的腳本,close()語法的位置在哪裏,它會是什麼?Ruby:如何在腳本中調用文件後關閉文件
print "Enter the filename you want to open here > "
filename = $stdin.gets.chomp
txt = open(filename)
puts "Here's your file #{filename}"
print txt.read
print "Type the filename again: "
file_again = $stdin.gets.chomp
txt_again = open(file_again)
print txt_again.read