|Introduction||Languages||Documentation||News||Implementations||Scorecard||Recent Changes||Mailing List||Wiki||Alioth|
Reverse A File
About this test
For this test, each program should be implemented to do the same thing, following the guidelines below:
This test reverses the input file from stdin, line by line. This is like the tail test in Timing Trials, or, the Trials of Timing: Experiments with Scripting and User-Interface Languages by Brian W. Kernighan and Christopher J. Van Wyk.
In this test, it's okay to use input methods other than line-oriented I/O, such as reading the entire input from stdin, as long as each read is no more than 4096 bytes at a time.
For this test, solutions can assume that the file ends with a trailing newline.
Perl and Ruby are ideally suited for this little test, and they both implement a one-line solution.
This section is for displaying alternate solutions that are either slower than ones above or perhaps don't quite meet my criteria for the competition, but are otherwise worthy of comment.