Boost C++ Libraries: Ticket #12665: boost::filesystem::path::replace_extension(const path& new_extension) produces inintuitive path on special directory https://svn.boost.org/trac10/ticket/12665 <p> Hi, I have read the specification of boost::filesystem::path::replace_extension(const path&amp; new_extension). It is very helpful in most of common use but the method may be ignore replacement when path represents the following cases: </p> <ul><li>dot (.) </li><li>dot-dot (..) </li><li>root-name (C:, <em>myserver, <br />myserver) </em></li></ul><p> The version available in boost 1.62.0 provide the following behaviour </p> <pre class="wiki">Replace extension on root path: (arguable) ------------------------------------------ replace_extension("/","txt") = "/.txt" replace_extension("C:\","txt") = "C:\.txt" Replace extension on special file-name -------------------------------------- replace_extension(".","txt") = "..txt" replace_extension("..","txt") = "...txt" replace_extension("/foo/.","txt") = "/foo/..txt" replace_extension("/foo/..","txt") = "/foo/...txt" Replace extension on root-name ------------------------------ replace_extension("C:","txt") = "C:.txt" replace_extension("\\myserver","txt") = "\\myserver.txt" </pre><p> Regards, Guillaume </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12665 Trac 1.4.3 Guillaume Labourey <guillaume.labourey@…> Fri, 09 Dec 2016 00:21:50 GMT attachment set https://svn.boost.org/trac10/ticket/12665 https://svn.boost.org/trac10/ticket/12665 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">replace_extension_on_directories.cpp</span> </li> </ul> Ticket Guillaume Labourey <guillaume.labourey@…> Fri, 09 Dec 2016 00:25:47 GMT component changed; owner set https://svn.boost.org/trac10/ticket/12665#comment:1 https://svn.boost.org/trac10/ticket/12665#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Beman Dawes</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">filesystem</span> </li> </ul> Ticket Guillaume Labourey <guillaume.labourey@…> Fri, 09 Dec 2016 00:27:08 GMT <link>https://svn.boost.org/trac10/ticket/12665#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12665#comment:2</guid> <description> <p> Change component to good field. </p> </description> <category>Ticket</category> </item> </channel> </rss>