KShellProcess Class Reference

`#include <kprocess.h>`

Inheritance diagram for KShellProcess:

## Public Member Functions

| KShellProcess (const char *shellname=0)
| ~KShellProcess ()
virtual bool | start (RunMode runmode=NotifyOnExit, Communication comm=NoCommunication)
Public Member Functions inherited from KProcess
| KProcess (QObject *parent, const char *name=0)
| KProcess ()
virtual | ~KProcess ()
bool | setExecutable (const QString &proc) KDE_DEPRECATED
KProcess & | operator<< (const QString &arg)
KProcess & | operator<< (const char *arg)
KProcess & | operator<< (const QCString &arg)
KProcess & | operator<< (const QStringList &args)
void | clearArguments ()
virtual bool | kill (int signo=SIGTERM)
bool | isRunning () const
pid_t | pid () const
KDE_DEPRECATED pid_t | getPid () const
void | suspend ()
void | resume ()
bool | wait (int timeout=-1)
bool | normalExit () const
bool | signalled () const
bool | coreDumped () const
int | exitStatus () const
int | exitSignal () const
bool | writeStdin (const char *buffer, int buflen)
bool | closeStdin ()
bool | closeStdout ()
bool | closeStderr ()
bool | closePty ()
void | closeAll ()
const QValueList< QCString > & | args ()
void | setRunPrivileged (bool keepPrivileges)
bool | runPrivileged () const
void | setEnvironment (const QString &name, const QString &value)
void | setWorkingDirectory (const QString &dir)
void | setUseShell (bool useShell, const char *shell=0)
void | detach ()
void | setUsePty (Communication comm, bool addUtmp)
KPty * | pty () const
bool | setPriority (int prio)

## Static Public Member Functions

static QString | quote (const QString &arg)
Static Public Member Functions inherited from KProcess
static QString | quote (const QString &arg)

## Protected Member Functions

virtual void | virtual_hook (int id, void *data)
Protected Member Functions inherited from KProcess
void | setupEnvironment ()
virtual int | setupCommunication (Communication comm)
virtual int | commSetupDoneP ()
virtual int | commSetupDoneC ()
virtual void | processHasExited (int state)
virtual void | commClose ()
void | setBinaryExecutable (const char *filename)
int | childOutput (int fdno)
int | childError (int fdno)

## Additional Inherited Members

Public Types inherited from KProcess
enum | Communication { NoCommunication = 0, Stdin = 1, Stdout = 2, Stderr = 4, AllOutput = 6, All = 7, NoRead = 8, CTtyOnly = NoRead, MergedStderr = 16 }
enum | RunMode { DontCare, NotifyOnExit, Block, OwnGroup }
enum | { PrioLowest = 20, PrioLow = 10, PrioLower = 5, PrioNormal = 0, PrioHigher = -5, PrioHigh = -10, PrioHighest = -19 }
Signals inherited from KProcess
void | processExited (KProcess *proc)
void | receivedStdout (KProcess *proc, char *buffer, int buflen)
void | receivedStdout (int fd, int &len)
void | receivedStderr (KProcess *proc, char *buffer, int buflen)
void | wroteStdin (KProcess *proc)
Protected Slots inherited from KProcess
void | slotChildOutput (int fdno)
void | slotChildError (int fdno)
void | slotSendData (int dummy)
Protected Attributes inherited from KProcess
QValueList< QCString > | arguments
RunMode | run_mode
bool | runs
pid_t | pid_
int | status
bool | keepPrivs
int | out [2]
int | in [2]
int | err [2]
QSocketNotifier * | innot
QSocketNotifier * | outnot
QSocketNotifier * | errnot
Communication | communication
const char * | input_data
int | input_sent
int | input_total

## Detailed Description

A class derived from KProcess to start child processes through a shell.

Deprecated:

Use KProcess and KProcess::setUseShell(true) instead.

Author
  Christian Czezatke e9025.nosp@m.461@.nosp@m.stude.nosp@m.nt.t.nosp@m.uwien.nosp@m..ac..nosp@m.at

Definition at line 899 of file kprocess.h.

## Constructor & Destructor Documentation

KShellProcess::KShellProcess | ( | const char * | shellname = `0` | ) |

Constructor.

If no shellname is specified, the user's default shell is used.

Definition at line 1115 of file kprocess.cpp.

KShellProcess::~KShellProcess | ( |  | ) |

Destructor.

Definition at line 1121 of file kprocess.cpp.

## Member Function Documentation

bool KShellProcess::start | ( | RunMode | runmode = `NotifyOnExit`,
|  | Communication | comm = `NoCommunication`
| ) |  |

virtual

Starts the process.

For a detailed description of the various run modes and communication semantics, have a look at the general description of the KProcess class. Note that if you use setUsePty( Stdout | Stderr, <bool> ), you cannot use Stdout | Stderr here - instead, use Stdout only to receive the mixed output.

The following problems could cause this function to return false:

- The process is already running.
- The command line argument list is empty.
- The the `comm` parameter is incompatible with the selected pty usage.
- The starting of the process failed (could not fork).
- The executable was not found.

Parameters

  runmode | The Run-mode for the process.
  comm | Specifies which communication links should be established to the child process (stdin/stdout/stderr). By default, no communication takes place and the respective communication signals will never get emitted.

Returns
  true on success, false on error (see above for error conditions)

Reimplemented from KProcess.

Definition at line 1129 of file kprocess.cpp.

The documentation for this class was generated from the following files:

- kprocess.h
- kprocess.cpp

KDE Home | KDE Accessibility Home | Description of Access Keys