#file #file-utility #utility #libraries

filewalker

A utility for walking lined files under certain conditions

1 unstable release

0.0.1 Jan 7, 2023

#8 in #libraries

21 downloads per month

MIT license

16KB
401 lines

filewalker

Crates.io Docs.rs CI

Taken and modified from mrfutils-rs which used it to walk lined .txt files from a specified location in the file.

Quick Start

An example:

let mut forward = vec![];
for line in open_file("file.txt", None, None, None).unwrap() {
    println!(line);
}

Another way is to use the builder pattern:

let mut forward = vec![];
let opener = OpenerBuilder::default()
    .path("file.txt".to_string())
    .position("end")
    .direction("backward")
    .build()
    .unwrap()
for line in opener.open() {
    println!(line);
}

Dependencies

~2.5MB
~52K SLoC