followfile 0.1.0

Provides Reader library for following file changes.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::io::Write;
use followfile::File;
    use tokio::io::AsyncReadExt;

#[tokio::main(flavor = "current_thread")]
async fn main() -> std::io::Result<()> {
    let input = tokio::fs::File::open(std::env::args().nth(1).unwrap()).await?;
    let mut input = File::from_reader(input);

    let mut buf = vec![0; 1024];
    while let Ok(n) = input.read(&mut buf).await {
        std::io::stdout().write_all(&buf[..n])?;
    }
    Ok(())
}