SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
avoid overwriting file or directory
Chris Luceca078acb86
diff --git a/weed/filer2/filer.go b/weed/filer2/filer.goindex 659054d868..0dde08d04d 100644--- a/weed/filer2/filer.go+++ b/weed/filer2/filer.go@@ -132,6 +132,12 @@ func (f *Filer) CreateEntry(entry *Entry) error {return fmt.Errorf("insert entry %s: %v", entry.FullPath, err)}} else {+ if oldEntry.IsDirectory() && !entry.IsDirectory() {+ return fmt.Errorf("existing %s is a directory", entry.FullPath)+ }+ if !oldEntry.IsDirectory() && entry.IsDirectory() {+ return fmt.Errorf("existing %s is a file", entry.FullPath)+ }if err := f.store.UpdateEntry(entry); err != nil {return fmt.Errorf("update entry %s: %v", entry.FullPath, err)}