diff options
Diffstat (limited to 'config.go')
-rw-r--r-- | config.go | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -5,6 +5,7 @@ import ( "os" "sync" + "go.lindenii.runxiyu.org/lindenii-common/misc" "go.lindenii.runxiyu.org/lindenii-common/scfg" ) @@ -33,3 +34,19 @@ func load_config(path string) error { } return nil } + +var directories struct { + inbox misc.Dir_t +} +var directories_mutex sync.RWMutex + +func prepare_dirs() error { + directories_mutex.Lock() + defer directories_mutex.Unlock() + var err error + directories.inbox, err = misc.Open_directory_readonly(config.Inbox_path) + if err != nil { + return err + } + return nil +} |