From 2586d10ea9c2569b53b7df72625ee3bb1b595c02 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 9 Mar 2008 17:38:55 +0000 Subject: [PATCH] CreateFile() didn't specify the B_ERASE_FILE, hence the file wouldn't be truncated, if already existing. This problem could be experienced when saving in Pe. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24329 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/storage/Directory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kits/storage/Directory.cpp b/src/kits/storage/Directory.cpp index c09ca5bea4..d54d18d206 100644 --- a/src/kits/storage/Directory.cpp +++ b/src/kits/storage/Directory.cpp @@ -791,8 +791,8 @@ BDirectory::CreateFile(const char *path, BFile *file, bool failIfExists) if (!path) return B_BAD_VALUE; // Let BFile do the dirty job. - uint32 openMode = B_READ_WRITE | B_CREATE_FILE - | (failIfExists ? B_FAIL_IF_EXISTS : 0); + uint32 openMode = B_READ_WRITE | B_CREATE_FILE | B_ERASE_FILE + | (failIfExists ? B_FAIL_IF_EXISTS : 0); BFile tmpFile; BFile *realFile = (file ? file : &tmpFile); status_t error = B_OK;