forgotten fix for write_append and non existing file

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7597 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-06-19 08:09:51 +00:00
parent b7bcf0138c
commit 4145aa5c05

View File

@@ -216,14 +216,19 @@ bool wxFile::Open(const wxChar *szFileName, OpenMode mode, int accessMode)
flags |= O_RDONLY;
break;
case write_append:
if ( wxFile::Exists(szFileName) )
{
flags |= O_WRONLY | O_APPEND;
break;
}
//else: fall through as write_append is the same as write if the
// file doesn't exist
case write:
flags |= O_WRONLY | O_CREAT | O_TRUNC;
break;
case write_append:
flags |= O_WRONLY | O_CREAT | O_APPEND;
break;
case read_write:
flags |= O_RDWR;
break;