- improve move-to-self detection, so this errors without data loss:
```diff
mkdir mydir
mv mydir mydir/subdir
-mv: No such file or directory (os error 2)
+mv: cannot move 'mydir' to a subdirectory of itself, 'mydir/subdir'
```
- align "cannot move source to a subdirectory of itself" and "same file"
errors more closely with coreutils:
```diff
mkdir mydir
mv mydir/ mydir/..
-mv: cannot move 'mydir/' to a subdirectory of itself, 'mydir/../mydir/'
+mv: 'mydir/' and 'mydir/../mydir' are the same file
```
Causing: https://github.com/nushell/nushell/issues/13082
This adds the `os_str_as_bytes_lossy` function, for when we want infallible
conversion across platforms, and improves the doc comments of similar functions
to be more accurate and better formatted.
The code above this line handles the case if `res` is
larger than `ngroups`, but `res < ngroups` is also a possibility,
which this line attempts to address but actually does not.
The original code resizes to `ngroups` which is a no-op (given
that `groups` is already `ngroups` size). The correct target for
re-sizing the `groups` is the result from the last `getgroups`,
i.e., `res`.
Splice is a Linux-specific syscall that allows direct data copying from
one file descriptor to another without user-space buffer. As of now, this
is used by `cp`, `cat`, and `install` when compiled for Linux and Android.
This exposes the non-UTF-8 functionality to callers. Support in `argument`,
`spec`, and `wc` are implemented, as their usage is simple. A wrapper only
returning valid unicode is used in `ls`, since proper handling of OsStrings
there is more involved (outputs that escape non-unicode work now though).
* cut.pl: adjust to our messages as they are better
but we still have some differences on this test
* cut: add some missing line return when needed
* cut: add failing tests covered by cut.pl
* Remove dup test
* cut: add spell-checker:ignore line to test
---------
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
Fix bug #6944
Rework the way batching is done with sort such that it doesn't open
more input files than necessary. Previously, the code would always
open one extra input file which causes problems in ulimit scenarios.
Add additional test case.
* stat: fix the quotes when dealing with %N
and other formats
should fix
tests/stat/stat-fmt.sh
* stats: use an enum instead of a string
* stats: split the functions into smaller functions
* stat: handle byte as a format for better display
* stat: handle error better. should make tests/stat/stat-printf.pl pass
* stat: Some escape sequences are non-standard
* Fix tests
* Take comments into account
* fix(seq): handle 0e... scientific notation without padding
- Updated the parse_exponent_no_decimal function to treat 0e... as zero.
- Added test cases to verify correct behavior for 0e15 and -w 0e15.
Fix: #6926
* fix(seq): improved parse for accurate BigDecimal handling
* apply missing cargo fmt formatting adjustments