Difference: 0LASubrStreamOpen (7 vs. 8)

Revision 82012-02-16 - JeanNeron

Line: 1 to 1
 
META TOPICPARENT name="APPXRuntimeSubroutineAPI"

.STREAM OPEN

Line: 32 to 32
 You can open more than one stream file at at time, so long as the <stream_name> is different. Once opened, a stream file stays open until either it is explicitly closed via .STREAM CLOSE or .STREAM CLOSE ALL or your session ends.

This command is run by the appx engine, not by 'shelling out' to the O/S level, therefore the file will have the permissions of the engine (if you are creating a file) or must be readable by the engine (if you are reading a file). On Linux/Unix systems, if the 'setuid' bit is set, then the permissions will be those of user 'appx'. If you do not have the 'setuid' bit set, then the permissions will be those of whatever user you have the engine configured to impersonate. On Windows the permissions will be those of the current user.

Added:
>
>
There are 3 special file names: STDIN:, STDOUT: and STDERR:. These allow you to pipe data into an Appx session or pipe data out, or both. For example, you could write a subroutine that opens STDIN: for reading and STDOUT: for writing. You can then pipe data to a command that starts appx and runs this subroutine:

date | appx -a=<your application id> -d=<your database id> -t=SUBR -p="NAME_OF_YOUR_SUBROUTINE"

Your subroutine then be able to read the output from the 'date' command. If your subroutine opened STDOUT: and wrote data to it, you could pipe the output from appx to another command:

appx -a=<your application id> -d=<your database id> -t=SUBR -p="NAME_OF_YOUR_SUBROUTINE" -s | more

Note the use of -s on the command line. This prevents Appx from outputting special terminal control characters to STDOUT:

 

Comments:

Read what other users have said about this page or add your own comments.

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback