Re:Why is it so difficult to write valid “tar” commands from...
by LukeShu on Wednesday March 25, 2015 @02:41PM
(#9265027)
I agree that ln is a little confusing. I've often explained it to people that it's the same order as if you were copying the file, but it creates a link instead.
Also, in sections 1 and 8 (shell), data typically flows from left-to-right across the line. The filename on the left flows into the link on the right. Data flows from the left of the pipe to the right.
Whereas in section 3 (C), data typically flows from right-to-left across the line. Variable assignment, memcpy, ...
There are of course exceptions (dup2, bcopy), but that's the general style for the order of arguments in *nix.
My brain thinks it breaks the idiom of `[cmd] [from] [to]` that cp, mv, etc use. You wouldn't say the example above is a link from real_dir to my_link, you'd say the opposite (and that's what the cli shows when you ls a link).