mirror of
https://github.com/aykhans/movier.git
synced 2025-09-09 07:40:45 +00:00
Rewritten in go and python
This commit is contained in:
16
server/pkg/utils/file.go
Normal file
16
server/pkg/utils/file.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package utils
|
||||
|
||||
import "os"
|
||||
|
||||
func MakeDirIfNotExist(path string) error {
|
||||
return os.MkdirAll(path, os.ModePerm)
|
||||
}
|
||||
|
||||
func IsDirExist(path string) (bool, error) {
|
||||
if _, err := os.Stat(path); err == nil {
|
||||
return true, nil
|
||||
} else if !os.IsNotExist(err) {
|
||||
return false, err
|
||||
}
|
||||
return false, nil
|
||||
}
|
Reference in New Issue
Block a user