Annoying bug in nix builtin readFile

It is not reasonable for Nix’s syntax to support all valid file system paths. For instance, file system paths permit spaces in file names. It’s not reasonable for Nix to support that in path literal syntax, because spaces are semantically relevant in Nix syntax (function application). I’m sure there’s countless other examples, since file system paths are basically allowed to include any bytes except for / (and I think \0?). As I said before, the solution is to use concatenation with a string literal. ./. + "@foo"./@foo, ./foo + " bar"./foo bar

2 Likes