Opened 6 years ago
Last modified 6 years ago
#12665 new Feature Requests
boost::filesystem::path::replace_extension(const path& new_extension) produces inintuitive path on special directory
| Reported by: | Owned by: | Beman Dawes | |
|---|---|---|---|
| Milestone: | To Be Determined | Component: | filesystem |
| Version: | Boost 1.62.0 | Severity: | Problem |
| Keywords: | filesystem path replace_extension | Cc: |
Description
Hi, I have read the specification of boost::filesystem::path::replace_extension(const path& new_extension). It is very helpful in most of common use but the method may be ignore replacement when path represents the following cases:
- dot (.)
- dot-dot (..)
- root-name (C:, myserver,
myserver)
The version available in boost 1.62.0 provide the following behaviour
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"
Regards, Guillaume
Attachments (1)
Change History (3)
by , 6 years ago
| Attachment: | replace_extension_on_directories.cpp added |
|---|
comment:1 by , 6 years ago
| Component: | None → filesystem |
|---|---|
| Owner: | set to |
comment:2 by , 6 years ago
Note:
See TracTickets
for help on using tickets.

Change component to good field.