Lasso Soft Inc. > Home

[ OS_Process ]

Method

[OS_Process] allows a native process to be started on the same machine as Lasso Service and for interactive communication with that process to take place. This allows shell scripts to be executed on Mac OS X, Linux, or Windows.

Important - Use of the [OS_Process] data type has several security implications. Any commands issued by this tag are run using the same privileges as Lasso Service. The [OS_Process] tag can be used to access files and other resources without respecting Lasso's built-in security settings. For these reasons the [OS_Process] data type is not installed by default. In order to use this type the OS_Process module must be moved from the Extensions folder to the LassoModules folder (both in the Lasso Professional application folder) and Lasso Service restarted. Use of this type is further restricted to members of the OS Process Users group which is automatically created or to the site administrator.

The [OS_Process] tag accepts three optional parameters which automatically open a native process. These include the path to the executable to call, an array of command line parameters, and an array of environment variables to set. Alternately, these same three parameters can be passed to the [OS_Process->Open] tag.

The executable which is launched will remain open until either the [OS_Process->Close] tag is called, the executable exits, or the [OS_Process] object is destroyed. Many executables will simply return results that can be read using [OS_Process->Read] or [OS_Process->ReadString], but other executables support interactive operation using [OS_Process->Write] to send additional commands or data to the executable and then reading the results. The [OS_Process->Detach] tag can be used to leave some processes running even after the [OS_Process] object has been destroyed.

  • Syntax
  • Methods
  • Traits
OS_Process('command', Array('command parameters'))
Has methods:
Has traits:
Examples
  • Beginner

To list the current working directory

Use the [os_process] object.

Code

local(myProcess = OS_Process('/bin/ls', Array('.')))
Encode_HTML(#myProcess->Read)
#myProcess->Close

Result

JavaLibraries
LassoApps
LassoLibraries
LassoModules
SQLiteDBs
lasso9.im.fastcgi.sock

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft