Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions proposals/filesystem/wit-0.3.0-draft/types.wit
Original file line number Diff line number Diff line change
Expand Up @@ -489,11 +489,11 @@ interface types {

/// Create a hard link.
///
/// Fails with `error-code::no-entry` if the old path does not exist,
/// with `error-code::exist` if the new path already exists, and
/// `error-code::not-permitted` if the old path is not a file.
/// Behavior is as described by [POSIX
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind keeping the previous description of failure modes, and adding this prose + link at the bottom with something like "for more information, see " ?

Laying out the common failure mode and meanings is reasonable in the docs, rather than (for the same reason we note the failure mode for hard links).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if only mentioning a subset of error modes might confuse the reader as being exhaustive; that was certainly my confusion when I read this at first.

The case of hard links is different, because it refines POSIX.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah that's a great point.

It's a bit crude but I really want to optimize for saving the user a dig down the rabbit hole if we know the answer for at least some of the platforms and corner cases. What do you think about a note that it is non-exhaustive?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, the sockets interface describes the possible errors too. But phrases them as "Typical errors"

This communicates clearly what common failure modes the caller can expect, but also doesn't rigidly tie things down for the implementation.

/// `linkat`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html).
///
/// Note: This is similar to `linkat` in POSIX.
/// Hard links between directories are forbidden, and produce either
/// `error-code::access` or `error-code::not-permitted` error results.
@since(version = 0.3.0-rc-2025-09-16)
link-at: async func(
/// Flags determining the method of how the path is resolved.
Expand Down