Jan Scheer
eb21330ade
Merge branch 'main' into tail_notify
2022-04-19 22:14:55 +02:00
Jan Scheer
a9fa94824d
tail: switch from Notify 5.0.0-pre.13 to 5.0.0-pre.14
2022-04-05 22:19:25 +02:00
Terts Diepraam
18369dc0be
all: use array intoiterator
2022-04-05 10:39:31 +02:00
DevSabb
1eee2194a3
head, tail: include presume-input-pipe parameter
2022-04-01 11:55:33 +02:00
Omer Tuchfeld
fa60898354
Adjust 32-bit tests for tail,split,truncate,head
2022-02-22 13:49:20 +01:00
Hanif Bin Ariffin
3586465917
dont use is_numeric to check for digits
...
Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.43262@gmail.com>
2022-02-03 21:42:22 +08:00
Daniel Eades
5af66753af
remove needless borrows
2022-01-30 14:01:21 +01:00
Sylvestre Ledru
b8b642101f
Merge pull request #2898 from jfinkels/tail-lines-zero-terminated
...
tail: support zero-terminated lines in streams
2022-01-30 09:44:04 +01:00
Jeffrey Finkelstein
83f96ec29d
tail: don't error when following non-UTF-8 data
...
Fix a bug where `tail -f` would terminate with an error due to failing
to parse a UTF-8 string from a sequence of bytes read from the
followed file. This commit replaces the call to `BufRead::read_line()`
with a call to `BufRead::read_until()` so that any sequence of bytes
regardless of encoding can be read.
Fixes #1050 .
2022-01-24 21:32:52 -05:00
Jeffrey Finkelstein
f595edaded
tail: fix a bug in tail [ -n | -c ] +NUM <file>
...
Fix a bug when getting all but the first NUM lines or bytes of a file
via `tail -n +NUM <file>` or `tail -c +NUM <file>`. The bug only
existed when a file is given as an argument; it did not exist when the
input data came from stdin.
2022-01-21 19:05:53 -05:00
Jeffrey Finkelstein
58d84d5107
tail: support zero-terminated lines in streams
...
Support `-z` option when the input is not a seekable file. Previously,
the option was accepted by the argument parser, but it was being
ignored by the application logic.
2022-01-21 18:31:15 -05:00
Jeffrey Finkelstein
ca812a7558
tail: rm trailing \n if input doesn't end with one
...
Fix a bug where `tail` would inappropriately add a newline to the last
line of output even though the input did not end with one.
2022-01-18 17:34:41 -05:00
Jeffrey Finkelstein
e575007629
tail: improve error handling when file not found
2022-01-17 10:57:24 -05:00
Smicry
fc851e036b
Implement tail -<number> ( #2747 )
...
And add obsolete_syntax test
2021-11-19 21:37:47 +01:00
Jan Scheer
18a06c310e
tail: add some tweaks to pass more of GNU's testsuite checks related to -F
2021-11-03 14:40:57 +01:00
Jan Scheer
a9c34ef810
test_tail: add more tests for --follow=name
2021-10-26 16:12:52 +02:00
Jan Scheer
1d2940b159
test_tail: add test_follow_name_truncate1-3
2021-10-24 22:31:14 +02:00
Jan Scheer
3f4b0146a1
test_tail: add test_follow_descriptor_vs_rename1-2
2021-10-24 22:28:30 +02:00
Jan Scheer
07eb50248b
test_tail: add test_retry8-9
2021-10-24 22:21:36 +02:00
Jan Scheer
016291b92e
test_tail: add test_retr7
2021-10-24 22:19:10 +02:00
Jan Scheer
c7c5deb3d8
test_tail: add test_retry6
2021-10-24 22:17:54 +02:00
Jan Scheer
4bfb462387
test_tail: add test_retry5
2021-10-24 22:15:14 +02:00
Jan Scheer
5770921f52
test_tail: add test_retry4
2021-10-24 22:13:58 +02:00
Jan Scheer
8c5c52801d
test_tail: add test_retry3
2021-10-24 22:12:40 +02:00
Jan Scheer
9338b3fd77
test_tail: add test_retry1-2
2021-10-24 22:03:00 +02:00
Jan Scheer
e3b35867a5
test_tail: clean up tests for --follow=name
2021-10-10 00:07:59 +02:00
Jan Scheer
a1206154b1
tail: fix the behavior for -f
and rename events
...
This makes uu_tail pass the "gnu/tests/tail-2/descriptor-vs-rename" test.
* add tests for descriptor-vs-rename (with/without verbose)
* fix some minor error messages
2021-10-08 23:36:41 +02:00
Jan Scheer
23d3e58f33
tail: improve file handling for --follow=name
...
* Change data structure from Vec to HashMap in order to better
keep track of files while watching them with `--follow=name`.
E.g. file paths that were removed while watching them and exit
if no files are remaining, etc.
* Move all logic related to file handling into a FileHandling trait
* Simplify handling of the verbose flag.
2021-10-07 14:37:02 +02:00
Jan Scheer
94cc966535
tail: change notify backend on macOS from FSEvents
to kqueue
...
On macOS only `kqueue` is suitable for our use case because `FSEvents`
waits until file close to delivers modify events.
2021-10-01 21:33:30 +02:00
Jan Scheer
e935d40480
tail: implement handling of truncate event for --follow=name
2021-09-28 20:05:09 +02:00
Jan Scheer
d9cd28fab6
test_tail: add tests for --follow=name --disable-inotify
(polling)
2021-09-28 00:16:23 +02:00
Jan Scheer
5615ba9fe1
test_tail: add tests for --follow=name
2021-09-27 23:18:00 +02:00
Jan Scheer
a727b2e666
tail: handle file NotFound error correctly
2021-09-16 21:40:15 +02:00
Jan Scheer
1f24b1f59c
tail: implement sub-second sleep interval e.g. -s.1
2021-09-16 17:14:23 +02:00
Jan Scheer
cd0d23752a
tail: add fixes to pass "gnu/tests/tail-2/tail-c.sh" from GNU's test suite
2021-09-08 13:10:19 +02:00
Thomas Queiroz
6127ea9642
tests/tail: add test for as an alias for stdin
2021-08-01 17:20:30 -04:00
Jan Scheer
c0be979611
fix some issues with locale (replace "LANGUAGE" with "LC_ALL")
...
`LANGUAGE=C` is not enough, `LC_ALL=C` is needed as the environment
variable that overrides all the other localization settings.
e.g.
```bash
$ LANGUAGE=C id foobar
id: ‘foobar’: no such user
$ LC_ALL=C id foobar
id: 'foobar': no such user
```
* replace `LANGUAGE` with `LC_ALL` as environment variable in the tests
* fix the the date string of affected uutils
* replace `‘` and `’` with `'`
2021-06-23 11:30:28 +02:00
Jan Scheer
f8e96150f8
fix clippy warnings and spelling
...
* add some missing LICENSE headers
2021-06-04 15:39:34 +02:00
Jan Scheer
ad26b7a042
head/tail/split: make error handling of NUM/SIZE arguments more
...
consistent
* add tests for each flag that takes NUM/SIZE arguments
* fix bug in tail where 'quiet' and 'verbose' flags did not override each other POSIX style
2021-06-03 20:37:29 +02:00
Jan Scheer
cc659c8572
Merge branch 'master' of github.com:uutils/coreutils into refactoring_parse_size
2021-06-01 12:35:48 +02:00
Jan Scheer
3c7175f00d
head/tail: add fixes and tests for bytes/lines NUM arg (undocumented sign)
...
* change tail bytes/lines clap parsing to fix posix override behavior
* change tail bytes/lines NUM parsing logic to be consistent with head
2021-06-01 12:17:11 +02:00
Jan Scheer
8bf1e33b5d
Merge branch 'master' of github.com:uutils/coreutils into refactoring_parse_size
...
* truncate: use "parse_size" from uucore
* workaround fix for "test_reference"
2021-05-31 19:11:06 +02:00
Roy Ivy III
3f35e0a421
refactor ~ cargo make format
2021-05-31 08:23:58 -05:00
Roy Ivy III
4e20dedf58
tests ~ refactor/polish spelling (comments, names, and exceptions)
2021-05-31 08:23:57 -05:00
Jan Scheer
3aeccfd802
fix a lot of clippy warnings
2021-05-29 15:11:22 +02:00
Jan Scheer
0bf14da490
tail: use "parse_size" from uucore
2021-05-28 22:21:03 +02:00
Sylvestre Ledru
4aaeede3d8
rustfmt the recent change
2021-05-23 00:13:53 +02:00
Jeffrey Finkelstein
bc29645531
tail: fix off-by-one issue for +NUM args
...
Fix an off-by-one issue for `tail -c +NUM` and `tail -n +NUM` command
line options.
2021-05-17 19:45:42 -04:00
Sylvestre Ledru
3ac481e4d3
rustfmt the recent change
2021-04-24 12:46:06 +02:00
James Robson
3678777539
tail --sleep-interval takes a value
2021-04-22 16:10:08 +01:00