3 ms·
You don't have to read all of a file into memory in Ruby. There are a number of facilities for reading only a portion of a file, readpartial[1] for example. Add
by pselbert 12y ago
You don't have to read all of a file into memory in Ruby. There are a number of facilities for reading only a portion of a file, readpartial[1] for example. Additionally, you have access to all of the native pipe[2] functionality as well. There are plenty of reasons to favor shell tools over Ruby, but those aren't some of them.
[1]: http://www.ruby-doc.org/core-2.1.2/IO.html#method-i-readpartial http://www.ruby-doc.org/core-2.1.2/IO.html#method-i-readpart...
[2]: http://www.ruby-doc.org/core-2.1.2/IO.html#method-c-popen http://www.ruby-doc.org/core-2.1.2/IO.html#method-c-popen