From c4b96658a0883d94186ce2b64305dcafaf567922 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 4 Jan 2025 21:01:08 +0800 Subject: Use Open_file_at instead of Open --- config.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'config.go') diff --git a/config.go b/config.go index f965c24..1ec7207 100644 --- a/config.go +++ b/config.go @@ -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 +} -- cgit v1.2.3