mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-06 18:15:59 +08:00
move Place
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package utils
|
||||
|
||||
import "os"
|
||||
|
||||
// Determine whether the given path is a folder
|
||||
func IsDir(path string) bool {
|
||||
s, err := os.Stat(path)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
return s.IsDir()
|
||||
}
|
||||
|
||||
// Determine whether the given path is a file
|
||||
func IsFile(path string) bool {
|
||||
return !IsDir(path)
|
||||
}
|
||||
|
||||
// Create a directory
|
||||
func MkDir(path string) error {
|
||||
return os.MkdirAll(path, os.ModePerm)
|
||||
}
|
||||
Reference in New Issue
Block a user