Skip to content

Instantly share code, notes, and snippets.

@ajuckel
Created October 17, 2013 14:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ajuckel/7025578 to your computer and use it in GitHub Desktop.
Rust 0.8 version of the file sort utility
extern mod extra;
use std::*;
use extra::*;
fn main() {
let reader = io::file_reader(&Path(os::args()[1])).unwrap();
let writer = io::file_writer(&Path(os::args()[2]),
[io::Append, io::Create]).unwrap();
let mut lines = reader.read_lines();
sort::quick_sort3(lines);
for l in lines.iter() {
writer.write_line(*l)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment