Extract the parent folder of a directory using boost::filesystem There is method parent_path, check the docs.