+ while (current(*ted, curr, files)) {
+ // we have a good directory to show.
+ directory_tree::depth(*ted, depth);
+ int found = curr.find(old_root);
+ if (found < common::OKAY) {
+ LOG(astring("failed to find prefix of path '") + old_root
+ + "' in the current directory '" + curr + "'");
+ return found;
+ }
+ curr = curr.substring(found + old_root.length(), curr.end());
+//LOG(astring("curr now is: ") + curr);
+ filename dir_to_make(new_root + "/" + curr);
+#ifdef DEBUG_DIRECTORY_TREE
+ LOG(astring("creating dir: ") + dir_to_make.raw());
+#endif
+ directory::recursive_create(dir_to_make.raw());
+ next(*ted);
+ }
+
+ throw_out(ted);
+ return common::OKAY;
+}
+
+} //namespace.