diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.go index 67dd2a62c..2b0ef64c2 100644 --- a/weed/filesys/wfs.go +++ b/weed/filesys/wfs.go @@ -89,6 +89,7 @@ func NewSeaweedFileSystem(option *Option) *WFS { }, } if option.CacheSizeMB > 0 { + os.MkdirAll(option.CacheDir, 0755) wfs.chunkCache = chunk_cache.NewChunkCache(256, option.CacheDir, option.CacheSizeMB) grace.OnInterrupt(func() { wfs.chunkCache.Shutdown() diff --git a/weed/util/file_util.go b/weed/util/file_util.go index bef9f7cd6..ff725830b 100644 --- a/weed/util/file_util.go +++ b/weed/util/file_util.go @@ -49,6 +49,10 @@ func CheckFile(filename string) (exists, canRead, canWrite bool, modTime time.Ti exists = false return } + if err != nil { + glog.Errorf("check %s: %v", filename, err) + return + } if fi.Mode()&0400 != 0 { canRead = true }