View Full Version : moving between folders (boost::filesystem)

10-21-2008, 01:06 AM
Hello all

I am trying to "move" from folder to folder. (like: set def ... or cd ..)
i need a short program (c++) using boost::filesystem to do it (if possible)

how can i do it if it's not possible using: boost::filesystem


ralph l mayo
10-21-2008, 06:13 AM
boost::filesystem doesn't offer this, it just expects you to pass a path object for the directory you want to use (but doesn't actually change the working directory to it).

You'll have to go to the native API.

Windows has SetCurrentDirectory (http://msdn.microsoft.com/en-us/library/aa365530.aspx) from Windows.h.

Posix (everything else) has chdir() from <unistd.h>