id summary reporter owner description type status milestone component version severity resolution keywords cc 2866 boost::filesystem::rename throw exception when target file exists, but documentation tell us that it must be replaced t.kozlov@… Beman Dawes "[Note: If from_p and to_p resolve to the same file, no action is taken. '''Otherwise, if to_p resolves to an existing file, it is removed'''. A symbolic link is itself renamed, rather than the file it resolves to being renamed. -- end note] A part from libs/filesystem/operations.cpp {{{ BOOST_FILESYSTEM_DECL error_code rename_api( const std::string & from, const std::string & to ) { return error_code( ::MoveFileA( from.c_str(), to.c_str() ) ? 0 : ::GetLastError(), system_category ); } }}} {{{ BOOST_FILESYSTEM_DECL error_code rename_api( const std::string & from, const std::string & to ) { // POSIX is too permissive so must check error_code dummy; if ( fs::exists( status_api( to, dummy ) ) ) return error_code( EEXIST, system_category ); return error_code( std::rename( from.c_str(), to.c_str() ) != 0 ? errno : 0, system_category ); } }}} And boost/filesystem/operation.hpp {{{ BOOST_FS_FUNC(void) rename( const Path & from_path, const Path & to_path ) { system::error_code ec( detail::rename_api( from_path.external_directory_string(), to_path.external_directory_string() ) ); if ( ec ) boost::throw_exception( basic_filesystem_error( ""boost::filesystem::rename"", from_path, to_path, ec ) ); } }}} " Bugs closed Boost 1.41.0 filesystem Boost 1.40.0 Problem fixed sean@…