aboutsummaryrefslogtreecommitdiff
path: root/weed/util/file_util.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-08-25 00:19:08 -0700
committerchrislu <chris.lu@gmail.com>2022-08-25 00:19:08 -0700
commitdbf0de4ce1a03323d46beafb1ede36302d61534e (patch)
treeb5ff7c11292030555c9fb1ad3bcdd5542f5a332c /weed/util/file_util.go
parent2930263dfdcc8891b313427b6160e70d5484bbc1 (diff)
downloadseaweedfs-dbf0de4ce1a03323d46beafb1ede36302d61534e.tar.xz
seaweedfs-dbf0de4ce1a03323d46beafb1ede36302d61534e.zip
minor clean up
Diffstat (limited to 'weed/util/file_util.go')
-rw-r--r--weed/util/file_util.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/weed/util/file_util.go b/weed/util/file_util.go
index 3cd4b1b23..346de76db 100644
--- a/weed/util/file_util.go
+++ b/weed/util/file_util.go
@@ -45,6 +45,16 @@ func FileExists(filename string) bool {
}
+func FolderExists(folder string) bool {
+
+ fileInfo, err := os.Stat(folder)
+ if err != nil {
+ return false
+ }
+ return fileInfo.IsDir()
+
+}
+
func CheckFile(filename string) (exists, canRead, canWrite bool, modTime time.Time, fileSize int64) {
exists = true
fi, err := os.Stat(filename)