X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..a9249b2eb2a40d8c71f828669045c4ddaa8dc5ff:/docs/latex/wx/file.tex diff --git a/docs/latex/wx/file.tex b/docs/latex/wx/file.tex index ac45262df2..fbb705f154 100644 --- a/docs/latex/wx/file.tex +++ b/docs/latex/wx/file.tex @@ -54,6 +54,8 @@ or test if it can be opened for writing with Access()} 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(). This is the same as {\bf wxFile::write} if the file doesn't exist.} +\twocolitem{{\bf wxFile::write\_excl}}{Open the file securely for writing (Uses O\_EXCL | O\_CREAT). +Will fail if the file already exists, else create and open it atomically. Useful for opening temporary files without being vulnerable to race exploits.} \end{twocollist} Other constants defined elsewhere but used by wxFile functions are wxInvalidOffset which represents an @@ -278,10 +280,13 @@ the number of bytes actually written \membersection{wxFile::Write}\label{wxfilewrites} -\func{bool}{Write}{\param{const wxString\& }{s}} +\func{bool}{Write}{\param{const wxString\& }{s}, \param{wxMBConv&}{ conv = wxConvLibc}} Writes the contents of the string to the file, returns TRUE on success. +The second argument is only meaningful in Unicode build of wxWindows when +{\it conv} is used to convert {\it s} to multibyte representation. + \section{\class{wxFFile}}\label{wxffile} wxFFile implements buffered file I/O. This is a very small class designed to @@ -328,7 +333,10 @@ Opens a file with the given file pointer, which has already been opened. \docparam{filename}{The filename.} -\docparam{mode}{The mode in which to open the file using standard C strings.} +\docparam{mode}{The mode in which to open the file using standard C strings. +Note that you should use {\tt "b"} flag if you use binary files under Windows +or the results might be unexpected due to automatic newline conversion done +for the text files.} \docparam{fp}{An existing file descriptor, such as stderr.} @@ -473,7 +481,10 @@ Number of bytes written. \membersection{wxFFile::Write}\label{wxffilewrites} -\func{bool}{Write}{\param{const wxString\& }{s}} +\func{bool}{Write}{\param{const wxString\& }{s}, \param{wxMBConv&}{ conv = wxConvLibc}} Writes the contents of the string to the file, returns TRUE on success. +The second argument is only meaningful in Unicode build of wxWindows when +{\it conv} is used to convert {\it s} to multibyte representation. +