emesx
emesx

Reputation: 12755

Boost path to file in directory pointed by a path

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");

Upvotes: 4

Views: 116

Answers (2)

Maxwe11
Maxwe11

Reputation: 486

use append e.g.

path /= filename; 

Upvotes: 3

eq-
eq-

Reputation: 10096

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

auto file = directory / "filename";

Upvotes: 2

Related Questions