...

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



meirab
10-21-2008, 12: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

thanks

ralph l mayo
10-21-2008, 05: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>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum