In this episode we'll mimic the behavior of command-line tools like Git that automatically page their output if they detect that they are being run from a terminal.
Tag: Input – Output
Episode #075: Tail Part 4: copy
Marching right along in our reimplementation of UNIX tail(1), today we tackle the problem of dumping the tail of the file to STDOUT once we've found the starting point.
Episode #072: Tail Part 1: Random Access
This episode kicks off a short miniseries on re-implementing a small subset of the UNIX "tail" command in Ruby. We'll start by learning how to jump around to arbitrary positions …
Episode #058: ARGF
This episode explores ARGF, a powerful object for working with input files in command-line programs.
Episode #042: Streaming
Does code optimized for RAM usage need to be ugly? Find out, in today's episode!
Episode #029: Redirecting Output
This episode takes a look at two different methods for redirecting standard out and standard error - one simple and quick, one more comprehensive.
Episode #023: Tempfile
In this episode we look at the Tempfile standard library, and how it can facilitate communicating with subprocesses.