Implementing an OS Service

Uniface enables you use an operating system service to send commands and return output from an operating system.

To create and use an OS service:

  1. Create a signature for an operating system service with the Implementation Type set to Operating System Command.

    Two default, non-editable operations are available, COMMAND and COMMANDOUT.

  2. In the calling component, call the OS service using the activate statement.

    For example, if you created a component called OSUNIX:

    activate "OSUNIX".COMMAND("at -fm myscript now")
    activate "OSUNIX".COMMANDOUT("ls -l mydir", $LISTING$)

    Output is passed to the $LISTING$ variable.

  3. In your application’s assignment file, specify a path that directs the operating system component to the operating system server.

    For example:

    [PATHS]
    $SERVER1:=TCP:PHOENIX|leda|?|CSV
    
    [SERVICES_EXEC]
    OSUNIX=$SERVER1:OSUNIX

Related Topics