Opened 14 years ago
Closed 12 years ago
#2731 closed Bugs (duplicate)
std::basic_fstream open for wpath assigns mode
Reported by: | Owned by: | Beman Dawes | |
---|---|---|---|
Milestone: | Boost 1.38.0 | Component: | filesystem |
Version: | Boost 1.37.0 | Severity: | Problem |
Keywords: | Cc: |
Description
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
This was fixed by ticket 3884. I'm not sure why it wasn't fixed at the time 2731 was opened.
Thanks,
--Beman