path="test.txt"
port=open(path)
begin
port.each_line{|line|
p line.to_s
}
ensure
port.close
end
STDOUT << "i love you \n"
port=open('test.txt')
s=port.stat
p s.ftype
p s.dev
p s.ino
p s.mode
p s.nlink
begin
a=port.readlines
a=port.each{|e| p e}
ensure
port.close
end
|
请发表评论