MCPcopy Create free account
hub / github.com/foxcpp/maddy / ensureDirectoryWritable

Function ensureDirectoryWritable

maddy.go:313–326  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

311}
312
313func ensureDirectoryWritable(path string) error {
314 if err := os.MkdirAll(path, 0o700); err != nil {
315 return err
316 }
317
318 testFile, err := os.Create(filepath.Join(path, "writeable-test"))
319 if err != nil {
320 return err
321 }
322 if err := testFile.Close(); err != nil {
323 log.Println("failed to close writeable-test file:", err)
324 }
325 return os.RemoveAll(testFile.Name())
326}
327
328func ReadGlobals(c *container.C, cfg []config.Node) (map[string]interface{}, []config.Node, error) {
329 globals := config.NewMap(nil, config.Node{Children: cfg})

Callers 1

InitDirsFunction · 0.85

Calls 4

PrintlnFunction · 0.92
CreateMethod · 0.65
CloseMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected