2019-07-30 15:31:13 +0100, Geoff Clare: [...] > It's not invention because the standard already requires it. (It also > requires EACCES, ELOOP, ENAMETOOLONG, ENOENT, ENOTDIR to be treated as > errors. The question is which ones the standard should be changed to > say are ignored.) [...]
By that reading, you could also say that test -f /etc/passwd/file should report an error because of the ENOTDIR error returned by stat(). How is it different? Surely the "errors" utilities are meant to report are those that they *consider* an error, not every error by any of the syscall their implementation makes. IMO, it's a bit far fetched to see the spec as requiring sh to fail upon a ENOENT error upon lstat() here (that would mean */file expansion could only succeed if all the non-hidden files in the current directory were searchable directories and contained a "file" entry) though it wouldn't harm to make it more explicit. -- Stephane