Skip to content

Commit dd5acba

Browse files
authored
Document the link function's error conditions. (#165)
* Document the `link` function's error conditions. Document that `link` fails if old-path doesn't exist or isn't a file, or if new-path already exists. * Autogenerate imports.md.
1 parent d6be43f commit dd5acba

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

imports.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,9 @@ WASI.</p>
11571157
</ul>
11581158
<h4><a id="method_descriptor_link_at"></a><code>[method]descriptor.link-at: func</code></h4>
11591159
<p>Create a hard link.</p>
1160+
<p>Fails with <a href="#error_code.no_entry"><code>error-code::no-entry</code></a> if the old path does not exist,
1161+
with <a href="#error_code.exist"><code>error-code::exist</code></a> if the new path already exists, and
1162+
<a href="#error_code.not_permitted"><code>error-code::not-permitted</code></a> if the old path is not a file.</p>
11601163
<p>Note: This is similar to <code>linkat</code> in POSIX.</p>
11611164
<h5>Params</h5>
11621165
<ul>

wit/types.wit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,10 @@ interface types {
508508

509509
/// Create a hard link.
510510
///
511+
/// Fails with `error-code::no-entry` if the old path does not exist,
512+
/// with `error-code::exist` if the new path already exists, and
513+
/// `error-code::not-permitted` if the old path is not a file.
514+
///
511515
/// Note: This is similar to `linkat` in POSIX.
512516
@since(version = 0.2.0)
513517
link-at: func(

0 commit comments

Comments
 (0)