What is the simplest way to get the directory that a file is in? I\'m using this to find the working directory.
string filename = \"C:\\MyDirectory\\MyFile.b
Use the Boost.filesystem parent_path() function.
Ex. argument c:/foo/bar => c:/foo
More examples here : path decomposition table and tutorial here.