[Boost-bugs] [Boost C++ Libraries] #2731: std::basic_fstream open for wpath assigns mode

Subject: [Boost-bugs] [Boost C++ Libraries] #2731: std::basic_fstream open for wpath assigns mode
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-02-05 18:55:51


#2731: std::basic_fstream open for wpath assigns mode
--------------------------------+-------------------------------------------
 Reporter: jhamm_at_[hidden] | Owner: bemandawes
     Type: Bugs | Status: new
Milestone: Boost 1.38.0 | Component: filesystem
  Version: Boost 1.37.0 | Severity: Problem
 Keywords: |
--------------------------------+-------------------------------------------
 The open behavior of fstream for wpath seems to be different than path.
 The mode is assigned input and output flags in the wpath version.

 Is this correct behaviour?

 This is the best I could do for a diff:

 \boost\filesystem\fstream.hpp ====
 ***************
 *** 467,473 ****
       {
         std::basic_fstream<charT,traits>::open(
           detail::path_proxy( file_ph.external_file_string(),
 ! mode ).c_str(), mode | std::ios_base::in | std::ios_base::out
 );
       }

       template <class charT, class traits>
 --- 467,474 ----
       {
         std::basic_fstream<charT,traits>::open(
           detail::path_proxy( file_ph.external_file_string(),
 ! mode ).c_str(), mode ); //| std::ios_base::in |
 std::ios_base::out );
 ! // Note: this change seems more consistent with the non-wpath
 version.
       }

       template <class charT, class traits>
 ***************
 *** 476,482 ****
       {
         std::basic_fstream<charT,traits>::open(
           detail::path_proxy( file_ph.external_file_string(),
 ! mode ).c_str(), mode | std::ios_base::in | std::ios_base::out
 );
       }

   # endif
 --- 477,485 ----
       {
         std::basic_fstream<charT,traits>::open(
           detail::path_proxy( file_ph.external_file_string(),
 ! mode ).c_str(),
 ! mode ); //| std::ios_base::in | std::ios_base::out );
 ! // Note: this change seems more consistent with the non-wpath
 version.
       }

   # endif

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2731>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:59 UTC