Subject: [Boost-bugs] [Boost C++ Libraries] #7607: path should not infer an invisible "." at the end of a path that ends with a slash
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-10-30 15:22:46
#7607: path should not infer an invisible "." at the end of a path that ends with
a slash
----------------------------------------------------------+-----------------
Reporter: Craig Dickson <cdickson@â¦> | Owner: bemandawes
Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
Version: Boost 1.50.0 | Severity: Problem
Keywords: |
----------------------------------------------------------+-----------------
Currently, a path that ends with a slash (or backslash on Windows) is
treated as if it had an invisible "." at the end. For example,
filename("/usr/") returns ".", and iterating over path("/usr/") produces
the elements "/", "usr", and ".".
I think this is a design error, because it leads to unexpected behaviors.
For example, create_directories("foo/") fails even though the directory
"foo" is successfully created, because the code tries to conclude by
creating ".", which makes no sense and obviously will fail.
I think the effect of ending a path with a slash should simply be that the
final element (preceding the slash) is considered a directory name, not a
filename. Therefore filename("foo/") should return an empty string, and
has_filename("foo/") should return false. Most other operations, however,
should act as if the slash simply wasn't there. Iterating over
path("/usr/bin/"), for example, should return the elements "/", "usr", and
"bin", and create_directories("foo/") should behave exactly the same as
create_directories("foo").
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7607> 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:11 UTC