Question

I have a boost path that points to some directory. How do I construct a path that points to a file in that directory?

Please comment if this is an obvious thing. Im new to C++ and in Java it's this easy:

File file = new File(theDirectory, "filename.txt");
Était-ce utile?

La solution

use append e.g.

path /= filename; 

Autres conseils

Path has a convenience operator/ that you may find useful for this purpose:

auto file = directory / "filename";
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top