MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / Save

Function Save

internal/util/util.go:683–696  ·  view source on GitHub ↗

Basic save wrapper

(path string, data []byte, doSafe ...bool)

Source from the content-addressed store, hash-verified

681
682// Basic save wrapper
683func Save(path string, data []byte, doSafe ...bool) error {
684
685 path = filepath.FromSlash(path)
686
687 if len(doSafe) > 0 && doSafe[0] {
688 return SafeSave(path, data)
689 }
690
691 if err := os.WriteFile(path, data, 0777); err != nil {
692 return err
693 }
694
695 return nil
696}
697
698func FilePath(pathParts ...string) string {
699 if len(pathParts) == 1 {

Callers 2

SetValFunction · 0.92
TestSaveFunction · 0.70

Calls 1

SafeSaveFunction · 0.85

Tested by 1

TestSaveFunction · 0.56