Horrible, Drunk Code (but it works and demonstrates a point)

Over on StackOverflow otopolsky was asking about how to make an Erlang program that could read selected lines in a huge file, offset from the bottom, without exploding in memory (too hard). I mentioned the standard bit about front-loading and caching the work of discovering the linebreak locations, the fact that “a huge text file” […]