Fix the behavior of `cp` when both `--backup` and `--force` are
specified and the source and destination are the same file. Before
this commit, `cp` terminated without copying and without making a
backup. After this commit, the copy is made and the backup file is
made. For example,
$ touch f
$ cp --force --backup f f
results in a backup file `f~` being created.
Fix a bug where `cp` failed to copy ancestor directories when using
the `--parents` option. For example, before this commit:
$ mkdir -p a/b/c d
$ cp --parents a/b/c d
$ find d
d
d/c
After this commit
$ mkdir -p a/b/c d
$ cp --parents a/b/c d
$ find d
d
d/a
d/a/b
d/a/b/c
This commit also adds the correct messages for `--verbose` mode:
$ cp -r --parents --verbose a/b/c d
a -> d/a
a/b -> d/a/b
'a/b/c' -> 'd/a/b/c'
Fixes#3332.
Implement distributing lines of a file in a round-robin manner to a
specified number of chunks. For example,
$ (seq 1 10 | split -n r/3) && head -v xa[abc]
==> xaa <==
1
4
7
10
==> xab <==
2
5
8
==> xac <==
3
6
9
* hashsum: test b3sum::test_nonames for real
Signed-off-by: Huijeong Kim <herehuijeong@gmail.com>
* apply cargo format
Signed-off-by: Huijeong Kim <herehuijeong@gmail.com>
Before, the sort could work faster and we could be late with
the signal.
Now we create a new big file, `sort` can't process it in a minute,
so we can safely wait for the temporary directory to be created
and send a signal afterwards
Before the change it slept for 0.1 seconds and right after that
asserted if `sort` has created the directory. Sometimes `sort`
didn't manage to create the directory in 0.1 seconds.
So the change is it tries to wait for `timeout` starting with
0.1 seconds, and if directory was not found, it tries 4 more times,
each time increasing timeout twice. Once the directory is found
it breaks.
Make cp preserve the permissions of a directory when copying
it. Before this commit,
cp -pR src/ dest/
failed to copy the permissions of `src/` to `dest/`. After this
commit, the permissions are correctly copied.
While the rust coreutils semantics were arguably more correct,
they were different than the gnu split semantics when handling a
file without a trailing EOF. This patch addresses that difference
and allows passing one more GNU test suite.