char buffer[128];
std::string result = "";
std::shared_ptr<FILE> pipe(_popen(cmd, "r"), _pclose);
if (!pipe) {
throw std::runtime_error(COMMAND_EXECUTION_FAIL);
}
while (!feof(pipe.get())) {
if (fgets(buffer, 128, pipe.get()) != NULL) {
result += buffer;
}
}
gdy wpisuje dir itd wszystko działa ale jak chce zmienić ścieżkę cd <directory> to nie mogę.. nadal zostaje ta sama. Czy da się cos z tym zrobić?