aboutsummaryrefslogtreecommitdiff
path: root/go/weed/fix.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2014-03-09 18:50:09 -0700
committerChris Lu <chris.lu@gmail.com>2014-03-09 18:50:09 -0700
commite6e85a6b2cb18110e55921c7e88a82acb1c288e1 (patch)
tree38744adb760ffe49640e645f2ab3f4640990e283 /go/weed/fix.go
parent7283d68e32008cfd4507ae549b71d82a8ddaa47e (diff)
downloadseaweedfs-e6e85a6b2cb18110e55921c7e88a82acb1c288e1.tar.xz
seaweedfs-e6e85a6b2cb18110e55921c7e88a82acb1c288e1.zip
truncate file content during creating
Diffstat (limited to 'go/weed/fix.go')
-rw-r--r--go/weed/fix.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/go/weed/fix.go b/go/weed/fix.go
index 159e2dbde..3c09727c1 100644
--- a/go/weed/fix.go
+++ b/go/weed/fix.go
@@ -37,7 +37,7 @@ func runFix(cmd *Command, args []string) bool {
if *fixVolumeCollection != "" {
fileName = *fixVolumeCollection + "_" + fileName
}
- indexFile, err := os.OpenFile(path.Join(*fixVolumePath, fileName+".idx"), os.O_WRONLY|os.O_CREATE, 0644)
+ indexFile, err := os.OpenFile(path.Join(*fixVolumePath, fileName+".idx"), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
if err != nil {
glog.Fatalf("Create Volume Index [ERROR] %s\n", err)
}