tailf 0.1.2

A async `tail -f` for files
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use tailf::tailf;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let filename = std::env::args().nth(1).expect("Usage: tailf <filename>");
    let mut tailer = tailf(&filename, None)?;

    while let Some(line) = tailer.next().await? {
        let line_str = String::from_utf8_lossy(&line);
        print!("{}", line_str);
    }
    Ok(())
}