This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RFA: libstdc++-v3: Support opening files in append read/write mode
- From: Nick Clifton <nickc at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 29 Jul 2003 08:17:04 +0100
- Subject: RFA: libstdc++-v3: Support opening files in append read/write mode
Hi Guys,
Please may I have permission to apply the following patch ? It
allows files to be opened with a mode of (ios_base::in |
ios_base::out | ios_base::app) which translates into an fopen() call
with a mode of "a+".
Cheers
Nick
2003-07-29 Nick Clifton <nickc@redhat.com>
* config/io/basic_file_stdio.cc (__basic_file::_M_open_mode): Open
with "a+" if (ios_base::in | ios_base::out | ios_base::app) is
used as the mode.
Index: libstdc++-v3/config/io/basic_file_stdio.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/io/basic_file_stdio.cc,v
retrieving revision 1.17
diff -c -3 -p -r1.17 basic_file_stdio.cc
*** libstdc++-v3/config/io/basic_file_stdio.cc 14 Jul 2003 18:23:12 -0000 1.17
--- libstdc++-v3/config/io/basic_file_stdio.cc 29 Jul 2003 07:18:27 -0000
*************** namespace std
*** 94,99 ****
--- 94,104 ----
strcpy(__c_mode, "a");
__p_mode |= O_WRONLY | O_CREAT | O_APPEND;
}
+ if (__testi && __testo && !__testt && __testa)
+ {
+ strcpy(__c_mode, "a+");
+ __p_mode |= O_CREAT | O_APPEND;
+ }
if (!__testi && __testo && __testt && !__testa)
{
strcpy(__c_mode, "w");