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

 

                      

相关文章:

  • 2021-09-19
  • 2021-10-21
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
猜你喜欢
  • 2022-01-22
  • 2021-08-25
  • 2021-11-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案