1 runtime.exec
<runtime.exec encoding='encoding'>
<string /> !
</runtime.exec>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Aencoding | string | Type of coding of the input data (ISO-8859-1, UTF-8 ...). |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Estring | String |
Exceptions
requires 1 arguments, received: [...]
A incorrect number of arguments has been specified.
access to [...] forbiden, check security [...]
The file or command are in a prohibited access directory.
command [...] not found
The command to execute is not found in any of the authorized folders.
Remarks
For security, before use <runtime.exec>, you should perform the setting of the Axional Studio server node which will execute this commands. It consist in indicate in the maintenance of the Axional Studio Nodes of the wic_conf in the field Command directories of the section XSQL-Script the path of the directories of which is allowed the execution of commands, for example /bin, /usr/bin, /usr/sbin... (for the execution of command as ls, mkdir ...).
In addition there is also to indicate which are the routes of the accessible files from the Axional Studio server. It consists in indicate in the maintenance of Axional Studio Nodes of the wic_conf in the field File directory of the section XSQL-Script the path of the directories of which is allowed to use the files.
The differences paths separated by the character ',' (comma) and respeting the notation of the platform, the name of the disk drive in uppercase in the case of Windows systems and the separator character '/' (backslash) in the case of Unix/Linux systems.
The standard exit of the executed process is returned as result, being able to be captured in a variable for its previous processing.
To obtain the status of the execution should use the tag <runtime.status>
List the content of the directory /tmp.
<xsql-script name='runtime_exec_sample1'> <body> <set name="m_result"> <runtime.exec> <string>/bin/ls -l /tmp</string> </runtime.exec> </set> <println><m_result/></println> </body> </xsql-script>
Execute the command dd of the operative system to transform a file from the format EBCDIC to ASCII.
<xsql-script> <body> <set name="m_result"> <runtime.exec encoding='utf-8'> <string>/bin/dd conv=ascii,unblock cbs=128 obs=128 if=/home/jas/temp/536500070514204810_00029418.dat of=/home/jas/temp/536500070514204810_00029418.txt</string> </runtime.exec> </set> </body> </xsql-script>