[Boost-bugs] [Boost C++ Libraries] #3949: filesystem::rename() "does not exist" check is sometimes unwanted

Subject: [Boost-bugs] [Boost C++ Libraries] #3949: filesystem::rename() "does not exist" check is sometimes unwanted
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-02-19 22:01:04


#3949: filesystem::rename() "does not exist" check is sometimes unwanted
--------------------------------------------------+-------------------------
 Reporter: Paul Pogonyshev <pogonyshev@…> | Owner: bemandawes
     Type: Feature Requests | Status: new
Milestone: Boost 1.43.0 | Component: filesystem
  Version: Boost 1.42.0 | Severity: Problem
 Keywords: |
--------------------------------------------------+-------------------------
 POSIX allows to rename/move a file over another, unlike Windows.
 Currently, Boost (according to source code) explicitly adds a check
 against this, using an exists() call. However, sometimes POSIX behavior
 is desired, to avoid extra remove() call.

 Moreover, since exist()/remove()/rename() is inherently non-atomic (as are
 all filesystem operation), this unnecessarily (on POSIX) creates another
 race-condition point.

 Request: change rename prototype to rename(from, to, overwrite = false)
 and adjust code accordingly. If 'overwrite' is false (default) it will
 work just as now, so the change is fully backward-compatible. If
 overwrite is 'true', POSIX implementation will just omit its exist()
 check, while Windows implementation will call remove(to) and catch errors.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3949>
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