mirror of
https://github.com/safing/portmaster
synced 2025-04-07 12:39:09 +00:00
24 lines
455 B
Go
24 lines
455 B
Go
package dataroot
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"github.com/safing/portmaster/base/utils"
|
|
)
|
|
|
|
var root *utils.DirStructure
|
|
|
|
// Initialize initializes the data root directory.
|
|
func Initialize(rootDir string, perm utils.FSPermission) error {
|
|
if root != nil {
|
|
return errors.New("already initialized")
|
|
}
|
|
|
|
root = utils.NewDirStructure(rootDir, perm)
|
|
return root.Ensure()
|
|
}
|
|
|
|
// Root returns the data root directory.
|
|
func Root() *utils.DirStructure {
|
|
return root
|
|
}
|