Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Shell.CloseInput

Closes input stream.

Component Version macOS Windows Linux Server iOS SDK
Shell 8.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ❌ No
MBS( "Shell.CloseInput"; ShellRef )   More

Parameters

Parameter Description Example
ShellRef The reference number from the shell. $shell

Result

Returns OK or error.

Description

Closes input stream.
If needed, you can close the input stream after writing to it to signal end of file to the application.

Examples

Run a command line tool with input:

Set Variable [ $shell ; Value: MBS( "Shell.New" ) ]
Set Variable [ $s ; Value: MBS( "Shell.Execute"; $shell; "/Applications/Postgres.app/Contents/Versions/15/bin/gdaltransform"; "-s_srs"; "EPSG:25832"; "-t_srs"; "EPSG:4326"; "-output_xy") ]
# send input data and close input
Set Variable [ $s ; Value: MBS( "Shell.WriteInputText"; $shell; "666862 6716190"; "UTF-8") ]
Set Variable [ $s ; Value: MBS( "Shell.CloseInput"; $shell ) ]
# wait for app to finish
Set Variable [ $s ; Value: MBS( "Shell.Wait"; $shell; 5) ]
# read results
Set Variable [ $error ; Value: MBS( "Shell.ReadErrorText"; $shell; "UTF-8") ]
Set Variable [ $result ; Value: MBS( "Shell.ReadOutputText"; $shell; "UTF-8") ]
Set Field [ Shell::Error ; MBS( "Text.ReplaceNewline"; $error; 1) ]
Set Field [ Shell::Output ; MBS( "Text.ReplaceNewline"; $result; 1) ]
Set Variable [ $r ; Value: MBS("Shell.Release"; $shell) ]

See also

Release notes

Blog Entries

This function checks for a license.

Created 18th June 2018, last changed 30th January 2023


Shell.ClearEnvironment - Shell.CloseStreams