creating cd... or set def... with boost "filesystem"

hello all --------- there is a need to creating "cd..." or "set def..." with boost "filesystem" and make it transparent to windows\linux. there is a need to create one line of "filesystem" command. i don't know if there is a "wish list" or "to do list for a future version" - but it is needed - and sooner the better. today we have (for windows): -------------------------------------------------------------------------------------------------------------------- #include "stdafx.h" #include <stdio.h> #include <windows.h> #include <string> using namespace std; #include <atlstr.h> int main(void) { FILE *fp; CString dir = L"D:/schmidt26_cpp/mpi/debug"; // construct from a LPCWSTR //Set the current directory. SetCurrentDirectory( dir ); fp = _popen("DIR", "r"); if (fp != NULL) { char buffer[BUFSIZ]; while (fgets(buffer, sizeof buffer, fp) != NULL) fputs(buffer, stdout); } return 0; } -------------------------------------------------------------------------------------------------------------------- and for linux (posix): #include<stdio.h> #include <unistd.h> int main() { // D:\schmidt26_cpp\mpi\debug if(chdir("/home/kot/Desktop") != -1) printf("Successfully changed directory to Desktop!\n"); else printf("Error changing directory!\n"); /* if(fork()) execl("/usr/bin/xterm", "-e", "/usr/bin/emacs", (char*)0); else printf("Close the pop-up window first!\n"); wait(NULL); */ return 0; } -------------------------------------------------------------------------------------------------------------------- thank's all.

On Tue, Oct 28, 2008 at 18:06, M <meirab@gmail.com> wrote:
today we have (for windows):
SetCurrentDirectory( dir );
and for linux (posix):
if(chdir("/home/kot/Desktop") != -1)
http://www.boost.org/doc/libs/1_36_0/libs/filesystem/doc/reference.html#Attr... template <class Path> void current_path(const Path& p); Postcondition: equivalent( p, current_path() );
participants (2)
-
M
-
Scott McMurray