Command interpreter (ala win32 system('cmd'))?

A general discussion forum.
Posts: 4
Joined: 25 Aug 2010, 18:30
Location: St. Louis, MO USA

Command interpreter (ala win32 system('cmd'))?

Postby hardingdgh » 20 Sep 2010, 18:38


I was wondering if Poco provides a way to send a command to the system command intepreter like Win32 system() does? Now if you must know I simply want to be able to call "cls" or "clear" depending upon whether we're running on Win32 or Linux. My problem is that there is no portable console library (ala ncurses) which would allow me to manipulate the console. The funny thing is I just want to clear the screen and I might just issue a bunch of printf(\n) but apparently that was in this code previoulsy and for some reason the customer didn't like it.


Posts: 1266
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: Command interpreter (ala win32 system('cmd'))?

Postby guenter » 20 Sep 2010, 19:02

Code: Select all

#include "Poco/Process.h"
Poco::Process::Args args;
#ifdef _WIN32
Poco::ProcessHandle ph(Poco::Process::launch("cmd.exe", args));
Poco::ProcessHandle ph(Poco::Process::launch("clear", args));

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests