Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Sample 4: Remote command execution

&pagelevel(3)&pagelevel

The program sample4 is called in this way:

sample4 <command>

The name and transfer admission to the remote system are then requested in the dialog box.The program executes the command in the remote system and outputs the result (return code, stdout, stderr) on screen. The command must be specified in the same way as for ftexec. The admission profile in the remote system must permit command execution.

The program is structured as follows:

  • The function ft_xcopen() executes the command in the remote system and the results are internally buffered.

  • The calling system is informed of the exit code of the executed command and the number of data bytes present at stdout and stderr.

  • The data for stdout and stderr are read sequentially in a loop using ft_xcinfo() and are displayed.

  • Finally, ft_xcclose() is called to terminate command execution and release resources that are no longer required.