Lasso Soft Inc. > Home

[OS_Process->ReadString]

[OS_Process->ReadString] reads any available data from the standard output of the native process and returns a string value. This tag accepts two parameters. The first specifies the maximum number of bytes of data to retrieve. The tag will return all available data up to that number of bytes. By default all available data will be retrieved. A -Timeout parameter specifies the time in seconds which the tag should wait for output to become available. If no data is available before the read times out then an empty string is returned.

If [OS_Process->SetEncoding] has been called then the data from the native process is automatically translated from the specified character set to Lasso's native string format. If no encoding has been specified then Lasso expects the process to return data in UTF-8 format.

  • Syntax
  • Parameters
Var: 'myProcess' = (OS_Process: '/bin/cat');
$myProcess->(SetEncoding: 'iso-8859-1');
$myProcess->(Write: 'This is a test\n');
$myProcess->CloseWrite;
encode_html: $myProcess->ReadString;
$myProcess->Close;
Optional Parameters
length The maximum length in bytes of data to read from the native process.
-Timeout The maximum time to wait in seconds for data to become available for reading.
Examples

See the Lasso 8 Language Guide for examples of how to use this tag.

Tag Link [OS_Process->ReadString] Category OS Process
Type Member Data Source Any
Support Preferred Version 8.5
Output Type String Security None
Implementation Sets Lasso 8.5

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