New path build from current path and provided segments
import dshould; string tmp_dir = createTempDirectory(); scope(exit) std.file.rmdirRecurse(tmp_dir); auto ps = std.path.dirSeparator; Path("tmp").join("test1", "subdir", "2").toString.should.equal( "tmp" ~ ps ~ "test1" ~ ps ~ "subdir" ~ ps ~ "2"); Path root = Path(tmp_dir); root._path.should.equal(tmp_dir); auto test_c_file = root.join("test-create.txt"); test_c_file._path.should.equal(tmp_dir ~ ps ~"test-create.txt"); test_c_file.isAbsolute.should.be(true); version(Posix) { Path("/").join("test2", "test3").toString.should.equal("/test2/test3"); }
Join multiple path segments and return single path.