Crates.io | fileinput |
lib.rs | fileinput |
version | 0.3.0 |
source | src |
created_at | 2015-07-13 02:31:42.087698 |
updated_at | 2016-01-10 20:21:10.501743 |
description | Read input from multiple streams. |
homepage | https://github.com/spladug/fileinput.rs |
repository | https://github.com/spladug/fileinput.rs |
max_upload_size | |
id | 2596 |
size | 64,797 |
Read from multiple input streams like a cool CLI tool should.
use std::io::{BufRead,BufReader};
use fileinput::FileInput;
let filenames = vec!["testdata/1", "testdata/2"];
let fileinput = FileInput::new(&filenames);
let mut reader = BufReader::new(fileinput);
for line in reader.lines() {
println!("{}", line.unwrap());
}
The (minimal) API is documented: https://www.spladug.net/rust/fileinput/index.html
This package is on crates.io.
[dependencies]
fileinput = "*"
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
New commits in this repository are signed with my GPG key which can be found at keybase.io/spladug.