News for hackers. Stuff that matters.
Re:Fixing Unix/Linux/Posix Filenames: Control Characters (Su... by benj111 on Saturday March 09, 2019 @03:47PM (#19348382)
Surely the problem is the 'Everything is a stream of bytes' model?

Eg:

Ls | foo | bar

Ls just prints nl separated strings, no metadata, nothing to tell you what it is.

In current practical terms that means avoiding the shell, that isn't inherent though. I guess powershell avoids this issue.

Re:Fixing Unix/Linux/Posix Filenames: Control Characters (Su... by JdeBP on Sunday March 10, 2019 @05:00AM (#19351075)
Hence Greg Wooledge's famous advice not to parse the output of ls. As catern points out, in a fully-fledged systems programming language, one can just directly call the library routines that read directories. And thereby obtain metadata without having to parse it from locale-dependent forms, too.

* https://mywiki.wooledge.org/ParsingLs

* https://unix.stackexchange.com/a/503711/5132