Add clarifying documentation to Io.links#13791
Conversation
60b8781 to
6e76699
Compare
|
I pushed a new version with revised wording |
| (** Symlink with fallback to copy on systems that don't support it. *) | ||
| (** Symlink with fallback to copy on systems that don't support it. | ||
|
|
||
| The labels can be misleading: |
There was a problem hiding this comment.
I think saying that the labels can be misleading is a bit strong, because then otherwise why did we choose them?
I think an explanation like the following is enough:
[portable_symlink ~src ~dst] creates [dst] as a symbolic link
(or copy on Windows) pointing to [src]. *)
There was a problem hiding this comment.
I think this is the convention held up by GNU ln and other tools, but that doesn't mean they're not weird
There was a problem hiding this comment.
As an additional data point, I've heard this complaint a few times but ln is positional, in ln <from> <to> order which matches cp and nobody complains that cp is confusing.
There was a problem hiding this comment.
I agree that cp isn't confusing, it works like you'd expect. What I didn't expect was for ln to work like a copy, where I'd figured it would work like an arrow.
I've pushed revised wording
6e76699 to
b8dfd51
Compare
|
Pushed revised wording, and rebased on main for good measure |
Signed-off-by: Ambre Austen Suhamy <ambre@tarides.com>
b8dfd51 to
1f55f89
Compare
If you're thinking of a symlink as an arrow
A -> B, the signatureval link: src:Path.t -> dst:Path.t -> unitmight lead you to believe you should use it like solink ~src:A ~dst:B, but you'd be wrong!It's the reverse you should be doing.
It threw me off for a loop, so I'm trying to improve the documentation.
Suggestions welcome