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

Method SetStdinFile

wasi.go:103–113  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

101}
102
103func (c *WasiConfig) SetStdinFile(path string) error {
104 pathC := C.CString(path)
105 ok := C.wasi_config_set_stdin_file(c.ptr(), pathC)
106 runtime.KeepAlive(c)
107 C.free(unsafe.Pointer(pathC))
108 if ok {
109 return nil
110 }
111
112 return errors.New("failed to open file")
113}
114
115func (c *WasiConfig) InheritStdin() {
116 C.wasi_config_inherit_stdin(c.ptr())

Callers

nothing calls this directly

Calls 1

ptrMethod · 0.95

Tested by

no test coverage detected