Skip to content

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.

delete old file first on windows

Chris Luf87f2045b34e
diff --git a/weed/storage/volume_vacuum.go b/weed/storage/volume_vacuum.go
index 34e3db66bc..185484477c 100644
--- a/weed/storage/volume_vacuum.go
+++ b/weed/storage/volume_vacuum.go
@@ -3,6 +3,7 @@ package storage
import (
"fmt"
"os"
+ "runtime"
"time"
"github.com/chrislusf/seaweedfs/weed/glog"
@@ -111,6 +112,10 @@ func (v *Volume) CommitCompact() error {
return e
}
} else {
+ if runtime.GOOS == "windows" {
+ os.RemoveAll(v.FileName() + ".dat")
+ os.RemoveAll(v.FileName() + ".idx")
+ }
var e error
if e = os.Rename(v.FileName()+".cpd", v.FileName()+".dat"); e != nil {
return fmt.Errorf("rename %s: %v", v.FileName()+".cpd", e)