MCPcopy Create free account
hub / github.com/MertJSX/folderhost / CreateIfNotExists

Function CreateIfNotExists

utils/copy_functions.go:72–82  ·  view source on GitHub ↗
(dir string, perm os.FileMode)

Source from the content-addressed store, hash-verified

70}
71
72func CreateIfNotExists(dir string, perm os.FileMode) error {
73 if IsExistingPath(dir) {
74 return nil
75 }
76
77 if err := os.MkdirAll(dir, perm); err != nil {
78 return fmt.Errorf("failed to create directory: '%s', error: '%s'", dir, err.Error())
79 }
80
81 return nil
82}
83
84func CopySymLink(source, dest string) error {
85 link, err := os.Readlink(source)

Callers 1

CopyDirectoryFunction · 0.85

Calls 1

IsExistingPathFunction · 0.85

Tested by

no test coverage detected