fs/io/FileOutputStream: use CREATE_ALWAYS instead of TRUNCATE_EXISTING

Fixes yet another breakage of creating the database+state file on
Windows.
This commit is contained in:
Max Kellermann
2015-02-10 13:41:09 +01:00
parent 676dfabc91
commit 9c83d3c78c

View File

@@ -39,7 +39,7 @@ FileOutputStream::Create(Path path, Error &error)
FileOutputStream::FileOutputStream(Path _path, Error &error) FileOutputStream::FileOutputStream(Path _path, Error &error)
:path(_path), :path(_path),
handle(CreateFile(path.c_str(), GENERIC_WRITE, 0, nullptr, handle(CreateFile(path.c_str(), GENERIC_WRITE, 0, nullptr,
TRUNCATE_EXISTING, CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL|FILE_FLAG_WRITE_THROUGH, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_WRITE_THROUGH,
nullptr)) nullptr))
{ {