I need a way to read from a file, but reloading the data from the disk each time. How can this be done, short of using File.reopen
every time?
Unbuffered Read from File--Ruby
293 views Asked by Linuxios At
1
I need a way to read from a file, but reloading the data from the disk each time. How can this be done, short of using File.reopen
every time?
You could use
IO#rewind
:This does of course require a seekable file but that shouldn't be a problem if you're using plain disk files.