coreutils/src/uu/tail
2022-05-17 14:13:20 +02:00
..
src Merge branch 'main' into tail_notify 2022-05-17 14:13:20 +02:00
Cargo.toml Merge branch 'main' into tail_notify 2022-05-17 14:13:20 +02:00
LICENSE Include license text in all published crates 2022-03-05 21:21:46 +01:00
README.md tail: update README 2022-04-24 15:09:28 +02:00

Notes / ToDO

Missing features

The -F flag (same as --follow=name --retry) has very good support on Linux (inotify backend), works good enough on macOS/BSD (kqueue backend) with some minor tests not working, and is fully untested on Windows.

Flags with features

  • fast poll := '-s.1 --max-unchanged-stats=1'
    • sub-second sleep interval e.g. -s.1
    • --max-unchanged-stats (only meaningful with --follow=name ---disable-inotify)
  • ---disable-inotify (three hyphens is correct)
  • `--follow=name'
  • `--retry'
  • -F' (same as --follow=name --retry`)

Others

  • The current implementation doesn't follow stdin in non-unix platforms
  • Since the current implementation uses a crate for polling, these flags are too complex to implement:
    • --max-unchanged-stats
    • check whether process p is alive at least every number of seconds (relevant for --pid)

Possible optimizations

  • Don't read the whole file if not using -f and input is regular file. Read in chunks from the end going backwards, reading each individual chunk forward.