Boost C++ Libraries: Ticket #5702: Filename is returned within quotes instead without https://svn.boost.org/trac10/ticket/5702 <p> In the reference (<a href="http://www.boost.org/doc/libs/1_47_0/libs/filesystem/v3/doc/reference.html#path-decomposition">http://www.boost.org/doc/libs/1_47_0/libs/filesystem/v3/doc/reference.html#path-decomposition</a>) it is said that for example the filename returned by filename() will be without the quotes: </p> <div class="wiki-code"><div class="code"><pre><span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="n">path</span><span class="p">(</span><span class="s">&quot;/foo/bar.txt&quot;</span><span class="p">).</span><span class="n">filename</span><span class="p">();</span> <span class="c1">// outputs &quot;bar.txt&quot; (without the quotes)</span> </pre></div></div><p> But actually I'm getting an output with the filename enclosed in quotes like: </p> <pre class="wiki">"bar.txt" </pre><p> I'm using Windows Vista. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5702 Trac 1.4.3 moritz@… Tue, 19 Jul 2011 07:31:08 GMT <link>https://svn.boost.org/trac10/ticket/5702#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5702#comment:1</guid> <description> <p> If found the origin of the bug: Since filename() returns an object of type "path" and the inserter and the extractor of the path object delimit the string with double-quotes (see <a href="http://www.boost.org/doc/libs/1_47_0/libs/filesystem/v3/doc/reference.html#path-inserter-extractor">http://www.boost.org/doc/libs/1_47_0/libs/filesystem/v3/doc/reference.html#path-inserter-extractor</a>) the filename is returned in quotes. </p> <p> To avoid this you can use </p> <div class="wiki-code"><div class="code"><pre><span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="n">path</span><span class="p">(</span><span class="s">&quot;/foo/bar.txt&quot;</span><span class="p">).</span><span class="n">filename</span><span class="p">().</span><span class="n">string</span><span class="p">();</span> <span class="c1">// outputs &quot;bar.txt&quot; without the quotes</span> </pre></div></div><p> Although I don't understand why filename() returns a path object instead of a normal string() it would be the easiest to change only the description in the reference and leave the code as is. </p> </description> <category>Ticket</category> </item> </channel> </rss>