The 'median' is a well-known statistic that tells you where the half-way point of your data is.
Its lesser-known dual statistic, the 'comedian', is a statistic that tells you when there's something funny about your data.
The 'median' is a well-known statistic that tells you where the half-way point of your data is.
Its lesser-known dual statistic, the 'comedian', is a statistic that tells you when there's something funny about your data.
@riley I keep thinking that I wish kernel error codes were more like an algebraic type, with each errno value carrying a different set of associated data items.
ENOENT should explain which component of the pathname didn't exist, e.g. open("foo/bar/baz") might give ENOENT("foo/bar"). If rename(2) fails it should say whether the source file or destination dir didn't exist; for a script exec, it should distinguish nonexistence of the script from the interpreter.
And similarly for other errnos.
Unix grump: if you 'exec' a script whose interpreter can't be found, you get ENOENT, which is exactly the same error code as if the script file itself wasn't there.
So if I prepend a directory to PATH containing a script I want to use instead of /usr/bin/foo, and the script has this problem, execvp() won't even notice – it just execs each $dir/foo until one doesn't give ENOENT – and my replacement will be _silently_ ignored, instead of telling me about the error. Arrgh!