Ruby: File

intro

  • File class is subclass of IO class.
  • use File is more straight forward than use IO directly.
  • note: #inspect returns a FakeFS::File obj which is not real File obj.
  • methods e.g.: #open, #close, #read, #write, #seek, #readlines, etc..
  • note: use #rewind before the second call #read.

你可能感兴趣的:(Ruby: File)