MCPcopy Create free account
hub / github.com/akash-network/node / writeFile

Function writeFile

testutil/network/util.go:224–236  ·  view source on GitHub ↗
(name string, dir string, contents []byte)

Source from the content-addressed store, hash-verified

222}
223
224func writeFile(name string, dir string, contents []byte) error {
225 file := filepath.Join(dir, name)
226
227 if err := os.MkdirAll(dir, 0o755); err != nil { //nolint: gosec
228 return fmt.Errorf("could not create directory %q: %w", dir, err)
229 }
230
231 if err := os.WriteFile(file, contents, 0o644); err != nil { //nolint: gosec
232 return err
233 }
234
235 return nil
236}

Callers 1

NewFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected