Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » UppHub » Added SysExec package
Added SysExec package [message #16047] Sun, 25 May 2008 09:49 Go to previous message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
A small package with some SysExec() functions to launch external commands and gather their output and error data.
Not the state of the art, but handy sometimes Smile

The provided functions are :

bool SysExec(String const &command, String const &args, const VectorMap<String, String> &Environ, String &OutStr, String &ErrStr);
bool SysExec(String const &command, String const &args, String &OutStr, String &ErrStr);
bool SysExec(String const &command, String const &args, const VectorMap<String, String> &Environ, String &OutStr);
bool SysExec(String const &command, String const &args, String &OutStr);
bool SysExec(String const &command, String const &args);


Parameters are :

command         : command executable name
args            : a line of arguments, space separated
Environ         : a VectorMap containing environment data to pass
OutStr          : a reference to a string that will contain command output
ErrStr          : a reference to a string that will contain command error output


Commands will return true on success, false otherwise.

Caveats :

1- it will block application if launched command hangs
2- no timeout provided... but could be easily added
3- no mean to have some 'progress' indication of running app, but could be easily added


Path will be searched for command, so a complete path is not necessary.
It "should" work on windows too, but I didn't test it yet.

Ciao

Max

[Updated on: Sun, 25 May 2008 09:50]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [SOLVED] Control4U_demo cannot close ?
Next Topic: Job package: A lightweight worker thread for non-blocking operations.
Goto Forum:
  


Current Time: Thu Mar 28 23:03:38 CET 2024

Total time taken to generate the page: 0.01545 seconds