MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime-go / SetStdoutFile

Method SetStdoutFile

wasi.go:120–130  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

118}
119
120func (c *WasiConfig) SetStdoutFile(path string) error {
121 pathC := C.CString(path)
122 ok := C.wasi_config_set_stdout_file(c.ptr(), pathC)
123 runtime.KeepAlive(c)
124 C.free(unsafe.Pointer(pathC))
125 if ok {
126 return nil
127 }
128
129 return errors.New("failed to open file")
130}
131
132func (c *WasiConfig) InheritStdout() {
133 C.wasi_config_inherit_stdout(c.ptr())

Callers 1

ExampleWasiConfigFunction · 0.95

Calls 1

ptrMethod · 0.95

Tested by 1

ExampleWasiConfigFunction · 0.76