1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2026-01-15 09:41:07 +00:00
uutils-coreutils/src/tail
Joseph Crail aa0ce61b3f tail: use read_line/read instead of lines/bytes
In order to work around lines() removing the newline byte and CRLF, I
switched from the iterator methods (lines/bytes) to the direct methods
(read_line/read). I also manually skipped lines/bytes.

Fixes #744.
2015-12-18 23:52:09 -05:00
..
Cargo.toml Refactor and simplify build for utilities. 2015-12-07 21:56:45 -05:00
main.rs Refactor and simplify build for utilities. 2015-12-07 21:56:45 -05:00
README.md tail: added size suffixes handling 2014-12-01 11:55:39 +01:00
tail.rs tail: use read_line/read instead of lines/bytes 2015-12-18 23:52:09 -05:00

Rudimentary tail implementation.

##Missing features:

Flags with features

  • --max-unchanged-stats : with --follow=name, reopen a FILE which has not changed size after N (default 5) iterations to see if it has been unlinked or renamed (this is the usual case of rotated log files). With inotify, this option is rarely useful.
  • --pid : with -f, terminate after process ID, PID dies
  • --quiet : never output headers giving file names
  • --retry : keep trying to open a file even when it is or becomes inaccessible; useful when following by name, i.e., with --follow=name
  • --verbose : always output headers giving file names

Others

The current implementation does not handle - as an alias for stdin.

##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.