import (
"errors"
+ "os"
+ "path/filepath"
)
type Ctx struct {
}
return node, nil
}
+
+func (ctx *Ctx) ensureRxDir(nodeId *NodeId) error {
+ dirPath := filepath.Join(ctx.Spool, nodeId.String(), string(TRx))
+ if err := os.MkdirAll(dirPath, os.FileMode(0700)); err != nil {
+ ctx.LogE("llp-ensure", SDS{"dir": dirPath, "err": err}, "")
+ return err
+ }
+ fd, err := os.Open(dirPath)
+ if err != nil {
+ ctx.LogE("llp-ensure", SDS{"dir": dirPath, "err": err}, "")
+ return err
+ }
+ fd.Close()
+ return nil
+}