1234567891011121314151617181920212223242526 |
- package util
- import (
- "cicv-data-closedloop/pji/common/log"
- "os"
- "path/filepath"
- )
- func CreateDir(directory string) {
-
- if _, err := os.Stat(directory); os.IsNotExist(err) {
-
- err := os.MkdirAll(directory, os.ModePerm)
- if err != nil {
- log.GlobalLogger.Info("创建目录时发生错误", err)
- }
- }
- }
- func CreateParentDir(filePath string) error {
- if err := os.MkdirAll(filepath.Dir(filePath), os.ModePerm); err != nil {
- return err
- }
- return nil
- }
|