Search code examples
c++boostboost-filesystem

How to convert boost::filesystem::path with ".." (go up) components to proper path


How to convert a boost::filesystem::path in a form of:

root/subdir1/subdir2/../some.file

to:

root/subdir1/some.file

with possibly multiple "go level up" operators?


Solution

  • Check out canonical from the Boost filesystem library.