(path string)
| 118 | } |
| 119 | |
| 120 | func (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 | |
| 132 | func (c *WasiConfig) InheritStdout() { |
| 133 | C.wasi_config_inherit_stdout(c.ptr()) |