From 59277cb364e6f2ef08f5a1562e23b38378629049 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 9 Jun 2000 15:49:59 +0000 Subject: [PATCH] wxFile::Open(write_append) will create file if it doesn't exist git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7551 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/file.tex | 3 ++- src/common/file.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/latex/wx/file.tex b/docs/latex/wx/file.tex index 0c13f3a1d4..ac45262df2 100644 --- a/docs/latex/wx/file.tex +++ b/docs/latex/wx/file.tex @@ -52,7 +52,8 @@ or test if it can be opened for writing with Access()} \twocolitem{{\bf wxFile::read\_write}}{Open file for reading and writing; can not be used with Access()} \twocolitem{{\bf wxFile::write\_append}}{Open file for appending: the file is opened for writing, but the old contents of the file is not erased and the file pointer is initially placed at the end of the file; -can not be used with Access()} +can not be used with Access(). This is the same as {\bf wxFile::write} if the +file doesn't exist.} \end{twocollist} Other constants defined elsewhere but used by wxFile functions are wxInvalidOffset which represents an diff --git a/src/common/file.cpp b/src/common/file.cpp index 1dd7cebdd8..54d431e42d 100644 --- a/src/common/file.cpp +++ b/src/common/file.cpp @@ -221,7 +221,7 @@ bool wxFile::Open(const wxChar *szFileName, OpenMode mode, int accessMode) break; case write_append: - flags |= O_WRONLY | O_APPEND; + flags |= O_WRONLY | O_CREAT | O_APPEND; break; case read_write: