From 1c65f71df8e4fd6eda6970035cd276cba03c5bcb Mon Sep 17 00:00:00 2001
From: Pat Hickey Return a stream for reading from a file. Return a stream for reading from a file, if available. May fail with an error-code describing why the file cannot be read. Multiple read, write, and append streams may be active on the same open
file and they do not interfere with each other. Note: This allows using
Functions
-read-via-stream: func
read-stream
, which is similar to read
in POSIX.
input-stream
input-stream
, error-code
>write-via-stream: func
Return a stream for writing to a file.
+Return a stream for writing to a file, if available.
+May fail with an error-code describing why the file cannot be written.
Note: This allows using write-stream
, which is similar to write
in
POSIX.
output-stream
output-stream
, error-code
>append-via-stream: func
Return a stream for appending to a file.
+Return a stream for appending to a file, if available.
+May fail with an error-code describing why the file cannot be appended.
Note: This allows using write-stream
, which is similar to write
with
O_APPEND
in in POSIX.
output-stream
output-stream
, error-code
>advise: func
Provide file advisory information on a descriptor.
diff --git a/wit/types.wit b/wit/types.wit index 627b638..0f7d96e 100644 --- a/wit/types.wit +++ b/wit/types.wit @@ -312,7 +312,9 @@ interface types { /// This [represents a resource](https://github.com/WebAssembly/WASI/blob/main/docs/WitInWasi.md#Resources). type descriptor = u32 - /// Return a stream for reading from a file. + /// Return a stream for reading from a file, if available. + /// + /// May fail with an error-code describing why the file cannot be read. /// /// Multiple read, write, and append streams may be active on the same open /// file and they do not interfere with each other. @@ -322,9 +324,11 @@ interface types { this: descriptor, /// The offset within the file at which to start reading. offset: filesize, - ) -> input-stream + ) -> result