diff options
| author | Chris Lu <chris.lu@gmail.com> | 2019-06-03 02:26:31 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2019-06-03 02:26:31 -0700 |
| commit | 7e80b2b8823a9bb8bac58100a76d6a5825c94be4 (patch) | |
| tree | f406744ba5e7302157de46a59b4e5c09abff067f /weed/util/file_util.go | |
| parent | 55be09996d8f82e461e1c464db82707c982b2b57 (diff) | |
| download | seaweedfs-7e80b2b8823a9bb8bac58100a76d6a5825c94be4.tar.xz seaweedfs-7e80b2b8823a9bb8bac58100a76d6a5825c94be4.zip | |
fix multiple bugs
Diffstat (limited to 'weed/util/file_util.go')
| -rw-r--r-- | weed/util/file_util.go | 10 |
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 + +} |
