Opened 12 years ago

Closed 12 years ago

#5149 closed Bugs (invalid)

Incorrect behavior of basic_path.remove_filename() function

Reported by: lcarreon@… Owned by: Beman Dawes
Milestone: To Be Determined Component: filesystem
Version: Boost 1.45.0 Severity: Problem
Keywords: basic_path remove_filename Cc:

Description

According to the documentation of basic_path.remove_filename(), the result should not contain any trailing slashes if the result is not the root directory. However, this is not what I am observing.

Here is an example of what I have observed. I invoked current_path<path>() and displayed a partial list of the properties of the result which are as follows:

string = 'C:/Devel/projects/compiler_tests/test_path'

file_string = 'C:\Devel\projects\compiler_tests\test_path'

directory_string = 'C:\Devel\projects\compiler_tests\test_path'

Afterwards, I invoked remove_filename() on the above and again displayed a partial list of the properties of the result which are as follows:

string = 'C:/Devel/projects/compiler_tests/'

file_string = 'C:\Devel\projects\compiler_tests\'

directory_string = 'C:\Devel\projects\compiler_tests\'

Am I misunderstanding the documentation because the above is not the result that I expected. However, if I invoked remove_filename() on the above and displayed the partial list of the properties of the result, I get the following:

string = 'C:/Devel/projects/compiler_tests'

file_string = 'C:\Devel\projects\compiler_tests'

directory_string = 'C:\Devel\projects\compiler_tests'

The above is the result I expected from the initial invocation of remove_filename().

Please clarify. Please note that I am observing the same behavior on Fedora Linux and Solaris 10 x86.

Change History (2)

comment:1 by lcarreon@…, 12 years ago

I have discovered that I'm seeing the above behavior because I'm using version 2 of the filesystem library. I have since switched to version 3 and the problem does not happen there. This bug report can be closed.

comment:2 by Beman Dawes, 12 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.