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
#include
#include <string>
using namespace std;
#include
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
#include
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.