wasi:path_open
wasi_syscalls)WebAssembly WASI Preview 1 (Wasmtime, WasmEdge, Wasmer, WAMR, Node.js)
wasi_snapshot_preview1
guest->hostWASI, wasip1, wasi_snapshot_preview1Summary
WASI wasi_snapshot_preview1 host syscall path_open. Open a file or directory. The returned file descriptor is not guaranteed to be the lowest-numbered file descriptor not currently open; it is randomized to prevent applications from depending on making assumptions about indexes, since this is error-prone in multi-threaded contexts. The returned file descriptor is guaranteed to be less than 2**31. Note: This is…
Syntax / Encoding
wasi_snapshot_preview1::path_open(fd: $fd, dirflags: $lookupflags, path: string, oflags: $oflags, fs_rights_base: $rights, fs_rights_inheriting: $rights, fdflags: $fdflags) -> (expected $fd (error $errno))
Operands
| Name | Description |
|---|---|
fd | WASI parameter `fd` of type `$fd` |
dirflags | Flags determining the method of how the path is resolved. |
path | The relative path of the file or directory to open, relative to the `path_open::fd` directory. |
oflags | The method by which to open the file. |
fs_rights_base | The initial rights of the newly created file descriptor. The implementation is allowed to return a file descriptor with fewer rights than specified, if and only if those rights do not apply to the type of file being opened. The *base* rights are rights that will apply to operations using the file descriptor itself, while the *inheriting* rights are rights that apply to file descriptors derived from it. |
fs_rights_inheriting | WASI parameter `fs_rights_inheriting` of type `$rights` |
fdflags | WASI parameter `fdflags` of type `$fdflags` |
error | The file descriptor of the file that has been opened. |