views:

57

answers:

2

Hi,

How can I use boost::filesystem::path to specify a relative path on Windows? This attempt fails:

boost:filesystem::path full_path("../asset/toolbox"); // invalid path or directory.

maybe to help me debug, how to get the current working directory with boost::filesystem?

Thanks.

A: 

getcwd = boost::filesystem::path full_path( boost::filesystem::current_path() );

hmuelner
A: 

When you type "../your/path" aren't you specifying a unix-like path? I think what you should do to get system specific paths is:

boost:filesystem::path full_path(".." / "asset" / "toolbox");

In this case the '/' is an operator concatenating paths in a system specific way and is not part of the path that you specify.

Midnighter
sorry but, this does not work?
Jake