Subject: [Boost-bugs] [Boost C++ Libraries] #3884: boost fstream 'enforces' in AND out mode. It should be be possible to open a read-only file using fstream.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-01-31 12:31:57
#3884: boost fstream 'enforces' in AND out mode. It should be be possible to open
a read-only file using fstream.
---------------------------------------------+------------------------------
Reporter: Sachin Garg <schngrg@â¦> | Owner: bemandawes
Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
Version: Boost 1.41.0 | Severity: Problem
Keywords: |
---------------------------------------------+------------------------------
boost fstream 'enforces' in AND out mode by adding both in and out flags
to the user specified file open mode.
Check boost\filesystem\fstream.hpp line 479, it does:
mode | std::ios_base::in | std::ios_base::out
This makes it impossible to use fstream object to open a file for only
reading or writing. This is especially troublesome when trying to open a
read-only file as open call will fail with access denied error.
Fix: fstream should not modify 'mode' value and use the user specified
value as is.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/3884> 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:50:02 UTC