MCPcopy Create free account
hub / github.com/OpenSN-Library/OpenSN-Library / WriteToFile

Function WriteToFile

daemon/utils/file_operator.go:50–60  ·  view source on GitHub ↗
(path string, data []byte)

Source from the content-addressed store, hash-verified

48}
49
50func WriteToFile(path string, data []byte) error {
51 fd, err := os.Create(path)
52
53 if err != nil {
54 return err
55 }
56
57 fd.Write(data)
58
59 return fd.Close()
60}
61
62func DeleteFile(path string) error {
63 err := os.Remove(path)

Callers

nothing calls this directly

Calls 1

CreateMethod · 0.65

Tested by

no test coverage detected