aboutsummaryrefslogtreecommitdiff
path: root/weed/util/file_util.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2019-06-03 02:26:31 -0700
committerChris Lu <chris.lu@gmail.com>2019-06-03 02:26:31 -0700
commit7e80b2b8823a9bb8bac58100a76d6a5825c94be4 (patch)
treef406744ba5e7302157de46a59b4e5c09abff067f /weed/util/file_util.go
parent55be09996d8f82e461e1c464db82707c982b2b57 (diff)
downloadseaweedfs-7e80b2b8823a9bb8bac58100a76d6a5825c94be4.tar.xz
seaweedfs-7e80b2b8823a9bb8bac58100a76d6a5825c94be4.zip
fix multiple bugs
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 8ff2978ba..78add6724 100644
--- a/weed/util/file_util.go
+++ b/weed/util/file_util.go
@@ -30,3 +30,13 @@ func GetFileSize(file *os.File) (size int64, err error) {
}
return
}
+
+func FileExists(filename string) bool {
+
+ _, err := os.Stat(filename)
+ if os.IsNotExist(err) {
+ return false
+ }
+ return true
+
+}