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
1 Distinguish between folders and common files, folders are listed first 2 Add some custom headers that need to be exposed
henry14ddd155082a
diff --git a/weed/filer/filer_search.go b/weed/filer/filer_search.goindex b26959cb08..2fe83b49d4 100644--- a/weed/filer/filer_search.go+++ b/weed/filer/filer_search.go@@ -38,7 +38,17 @@ func (f *Filer) ListDirectoryEntries(ctx context.Context, p util.FullPath, start}}- return entries, err+ //Distinguish between folders and common files, folders are listed first+ var folderEntries, commonEntries []*Entry+ for i, _ := range entries {+ if entries[i].IsDirectory() {+ folderEntries = append(folderEntries, entries[i])+ } else {+ commonEntries = append(commonEntries, entries[i])+ }+ }+ folderEntries = append(folderEntries, commonEntries...)+ return folderEntries, err}func (f *Filer) doListPatternMatchedEntries(ctx context.Context, p util.FullPath, startFileName string, inclusive bool, limit int, prefix, restNamePattern string) (matchedEntries []*Entry, missedCount int, lastFileName string, err error) {diff --git a/weed/server/filer_server_handlers_read.go b/weed/server/filer_server_handlers_read.goindex 4d61193eca..28027a0098 100644--- a/weed/server/filer_server_handlers_read.go+++ b/weed/server/filer_server_handlers_read.go@@ -100,6 +100,16 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request,w.Header().Set(k, string(v))}+ //Add some custom headers that need to be exposed+ seaweedHeaders := []string{}+ for i, _ := range w.Header() {+ if strings.Contains(i, "Seaweed") {+ seaweedHeaders = append(seaweedHeaders, i)+ }+ }+ seaweedHeaders = append(seaweedHeaders, "Content-Disposition")+ w.Header().Set("Access-Control-Expose-Headers", strings.Join(seaweedHeaders, ","))+//set tag countif r.Method == "GET" {tagCount := 0