mn8 Language Reference | Index    

Process

SUMMARY: ATTRIBUTES SUMMARY  ELEMENTS SUMMARY  NO CONSTRUCTORS  NO OPERATORS  METHODS SUMMARYDETAIL: ATTRIBUTE DETAILS  ELEMENT DETAILS  NO CONSTRUCTORS  NO OPERATORS  METHOD DETAILS

Description

Executes the specified external command in a separate process.

Usage

Execute the external 'ls' command with '-l' parameter and show results.

            $cmd typeOf Series
            $process typeof Process
            $cmd.add("ls")
            $cmd.add("-l")
            $process = $process.exec( $cmd )
            print $process/output

Send mail to specified user with specified subject and text message.

            $cmd typeOf Series
            $process typeof Process
            $cmd.add("mailto")
            $cmd.add("emailaddress")
            $cmd.add("-s")
            $cmd.add("Subject")
            $process.setInput("This is a test message.")
            $process = $process.exec( $cmd )

Version: 0.1
Authors:Szabo Csaba ()
Location:
Inherits: Concept

Attribute List

 @exitValue TYPEOF String LABEL "exitValue"
top

Element List

 error TYPEOF String LABEL "error"
 input TYPEOF String LABEL "input"
 output TYPEOF String LABEL "output"
top

Method List

Processexec (String $cmd, String $dir)
Processexec (String $cmd)
Processexec (Series $cmd, String $dir)
Processexec (Series $cmd)
setInput (String $value)
top
Methods inherited from: Concept
cloneConcept, extendsConcept, fromXML, getAllInheritedConcepts, getConceptAttribute, getConceptAttributeField, getConceptAttributeFields, getConceptAttributes, getConceptConstructors, getConceptElement, getConceptElementField, getConceptElementFields, getConceptElements, getConceptLabel, getConceptMethod, getConceptMethods, getConceptOperators, getConceptType, getErrorHandler, getInheritedConcepts, getResourceURI, hasConceptAttribute, hasConceptElement, hasConceptMethod, hasPath, isHidden, loadContent, setConceptLabel, setErrorHandler, setHidden, setShowEmpty, showEmpty, toTXT, toXML, setResourceURI

Detailed Attribute Info

@exitValue

Label:exitValue
Type:String
Is Static:false
Is Hidden:false
Show Empty:true

Indicates the exit value for the subprocess.

top

Detailed Element Info

error

Label:error
Type:String
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:true

Indicates the error value for the subprocess.

top

input

Label:input
Type:String
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:true

Indicates the input value for the subprocess.

top

output

Label:output
Type:String
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:true

Indicates the output value for the subprocess.

top

Detailed Method Info

exec (String $cmd, String $dir)
Parameters:
$cmd :The command to execute.
$dir : The working directory of the subprocess, or null if the subprocess should inherit the working directory of the current process.
Returns: Process
Exceptions:
execException :
(Error)
If unable to execute command.

Executes the specified command in a separate process with the specified working directory.

            $proc typeof Process
            $proc = $proc.exec("ls", "/home/guest/")
            print $proc/output
            -- the result is --
            output
              docs
              images
              notes.txt
            

top
exec (String $cmd)
Parameters:
$cmd :The command to execute.
Returns: Process
Exceptions:
execException :
(Error)
If unable to execute command.

Executes the command given as parameter.

            $proc typeof Process
            $proc = $proc.exec("ls")
            print $proc/output
            -- the result is --
            output
              logs
              tmp
              me.jpg
              report.doc
            

top
exec (Series $cmd, String $dir)
Parameters:
$cmd :A series containing the command to call and its arguments.
$dir : The working directory of the subprocess, or null if the subprocess should inherit the working directory of the current process.
Returns: Process
Exceptions:
execException :
(Error)
If unable to execute command.

Executes the specified command in a separate process with the specified working directory.

            $cmd typeof Series
            $cmd.add("ls")
            $cmd.add("-l")
            $proc typeof Process
            $proc = $proc.exec($cmd, "/home/guest/")
            print $proc/output
            -- the result is --
            output
              drwxr-xr-x    4 guest     guest         3456 Jul 31 13:21 docs
              drwxr-xr-x   15 guest     guest          496 Jul 15 15:12 images
              -rw-r--r--    1 guest     guest          835 Jun 25 11:38 notes.txt
            

top
exec (Series $cmd)
Parameters:
$cmd :A series containing the command to call and its arguments.
Returns: Process
Exceptions:
execException :
(Error)
If unable to execute command.

Executes the command given as parameter.

            $cmd typeof Series
            $cmd.add("ls")
            $cmd.add("-l")
            $proc typeof Process
            $proc = $proc.exec($cmd)
            print $proc/output
            -- the result is --
            output
              drwxr-xr-x    3 guest     guest          464 Jun 12 logs
              drwxr-xr-x    3 guest     guest          368 Jul 28 tmp
              -rw-r--r--    1 guest     guest       274758 Jul  5 20:01 me.jpg
              -rw-r--r--    1 guest     guest         9223 Jul 24 19:22 report.doc
            

top
setInput (String $value)
Parameters:
$value :A string to be set.
Returns:

Sets the input value to the specified value.

            $cmd typeOf Series
            $process typeof Process
            $cmd.add("mailto")
            $cmd.add("emailaddress")
            $cmd.add("-s")
            $cmd.add("Subject")
            $process.setInput("This is a test message.")
            $process = $process.exec( $cmd )
            

top