os
is a Python lib and thus not available in C++.
You could use e.g. std::filesystem
to use a similar as pathlib
:
#include <iostream>
#include <filesystem>
namespace fs = std::filesystem;
int main()
{
fs::path dir ("/tmp");
fs::path file ("foo.txt");
fs::path full_path = dir / file;
std::cout << full_path << std::endl;
return 0;
}
Code taken from here.