Antonio Diaz Diaz <[email protected]> writes:
> POSIX is encouraging implementations to disallow the creation of file
> names containing any bytes that have the encoded value of a <newline>
> character. See
> https://pubs.opengroup.org/onlinepubs/9799919799/utilities/compress.html
> section CHANGE HISTORY subsection Issue 8.
I meant to get around to mentioning this change on the Coreutils mailing
list.
It is my impression that this change was to avoid issues like the
following example:
$ touch $'abc\ndef'
$ for file in `find . -type f`; do stat "$file"; done
stat: cannot statx './abc': No such file or directory
stat: cannot statx 'def': No such file or directory
I don't think it was intended to prevent terminals from having
non-printable file names emitted.
I don't like the idea of rejecting file names that the file system
and/or operating system allow. If POSIX were to mandate the behavior,
then my personal preference would be to hide it behind POSIXLY_CORRECT.
Collin