fs: use new atomic package - use FileCreateWithPrefix() API

This commit is contained in:
Harshavardhana
2015-11-17 16:32:20 -08:00
parent 26f83f108a
commit 35b9f965f1
5 changed files with 29 additions and 12 deletions

View File

@@ -207,7 +207,7 @@ func (fs Filesystem) CreateObject(bucket, object, expectedMD5Sum string, size in
}
// write object
file, err := atomic.FileCreate(objectPath)
file, err := atomic.FileCreateWithPrefix(objectPath, "")
if err != nil {
return ObjectMetadata{}, probe.NewError(err)
}
@@ -250,7 +250,6 @@ func (fs Filesystem) CreateObject(bucket, object, expectedMD5Sum string, size in
return ObjectMetadata{}, probe.NewError(SignatureDoesNotMatch{})
}
}
file.File.Sync()
file.Close()
st, err := os.Stat(objectPath)