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
This commit is contained in:
parent
24326abfa3
commit
2586d10ea9
@ -791,8 +791,8 @@ BDirectory::CreateFile(const char *path, BFile *file, bool failIfExists)
|
|||||||
if (!path)
|
if (!path)
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
// Let BFile do the dirty job.
|
// Let BFile do the dirty job.
|
||||||
uint32 openMode = B_READ_WRITE | B_CREATE_FILE
|
uint32 openMode = B_READ_WRITE | B_CREATE_FILE | B_ERASE_FILE
|
||||||
| (failIfExists ? B_FAIL_IF_EXISTS : 0);
|
| (failIfExists ? B_FAIL_IF_EXISTS : 0);
|
||||||
BFile tmpFile;
|
BFile tmpFile;
|
||||||
BFile *realFile = (file ? file : &tmpFile);
|
BFile *realFile = (file ? file : &tmpFile);
|
||||||
status_t error = B_OK;
|
status_t error = B_OK;
|
||||||
|
Loading…
Reference in New Issue
Block a user