Difference: 0LASubrStreamOpen (1 vs. 12)

Revision 122016-03-02 - JeanNeron

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

.STREAM OPEN

Line: 42 to 42
 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:

Added:
>
>

Binary File Support - 5.4.4

 
Added:
>
>
Starting in Release 5.4.4, you can append 'Binary' to the <open mode> parameter (ie, READ BINARY). In binary mode the <line termination> is automatically set to NONE regardless of whether you pass it or not. When reading a stream opened with the binary parameter you can tell the API how many characters to read, regardless of any embedded LF or CR/LF characters. When writing binary files, you can tell the API how many characters to write, again regardless of any embedded control characters.
 

Comments:

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

Deleted:
<
<

 What is the maximum length for the pathname?

-- Erik Gimbergh - 2015-04-15

Added:
>
>
It will accept a path name up to 32k long.

-- Jean Neron - 2016-03-02

 
<--/commentPlugin-->

-- PeteBrower - 2011-08-12 \ No newline at end of file

Revision 112015-04-15 - ErikGimbergh

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

.STREAM OPEN

Line: 47 to 47
  Read what other users have said about this page or add your own comments.
Changed:
<
<

<--/commentPlugin-->
>
>

What is the maximum length for the pathname?

-- Erik Gimbergh - 2015-04-15

<--/commentPlugin-->
  -- PeteBrower - 2011-08-12 \ No newline at end of file

Revision 102012-04-12 - JeanNeron

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

.STREAM OPEN

Line: 37 to 37
  date | appx -a=<your application id> -d=<your database id> -t=SUBR -p="NAME_OF_YOUR_SUBROUTINE"
Changed:
<
<
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:
>
>
Your subroutine will 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

Revision 92012-03-21 - JeanNeron

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

.STREAM OPEN

Line: 17 to 17
 

Description:

Changed:
<
<
This subroutine is called to open a file stream. A file stream can point to an actual file on the filesystem, or it can be output from an O/S command (eg, opening a 'pipe' via a file name of "|dir" or "|ls- l").
>
>
This subroutine is called to open a file stream. A file stream can point to an actual file on the filesystem, or it can be output from an O/S command (eg, opening a 'pipe' via a file name of "|dir" or "|ls- l"), or it can be a URL (eg, http://www.appx.com).
  The first three parameters are required, and the subroutine will CANCEL if they are are not all received. The <line_termination> parameter is optional.

<stream_name> is the symbolic name of the stream used to open the file (Required). This can be any name you desire. All subsequent operations on this stream will be via this name.

Changed:
<
<
<pathname> is the actual file to be opened (ie, /tmp/appx-registration.txt) or the pipe to be read (ie, "|ls -l /tmp") (Required). If you are opening a file for WRITE or APPEND, Appx will also create the path if necessary.
>
>
<pathname> is the actual file to be opened (ie, /tmp/appx-registration.txt), the pipe to be read (ie, "|ls -l /tmp") or the URL to be read (ie, http://www.appx.com) (Required). If you are opening a file for WRITE or APPEND, Appx will also create the path if necessary.
  <open_mode> determines how the file will be opened. Valid values are READ, WRITE, and APPEND. You may also just use the first letter of each word (R, W, A).

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.

Revision 72012-01-25 - JeanNeron

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

.STREAM OPEN

Line: 21 to 21
  The first three parameters are required, and the subroutine will CANCEL if they are are not all received. The <line_termination> parameter is optional.
Changed:
<
<
<stream_name> identifies the symbolic name of the stream used to open the file (Required). This can be any name you desire. All subsequent operations on this stream will be via this name.
>
>
<stream_name> is the symbolic name of the stream used to open the file (Required). This can be any name you desire. All subsequent operations on this stream will be via this name.
 
Changed:
<
<
<pathname> identifies the actual file to be opened (ie, /tmp/appx-registration.txt) or the pipe to be read (ie, "|ls -l /tmp") (Required). If you are opening a file for WRITE or APPEND, Appx will also create the path if necessary.
>
>
<pathname> is the actual file to be opened (ie, /tmp/appx-registration.txt) or the pipe to be read (ie, "|ls -l /tmp") (Required). If you are opening a file for WRITE or APPEND, Appx will also create the path if necessary.
 
Changed:
<
<
<open_mode> identifies how the file will be opened. Valid values are READ, WRITE, and APPEND. You may also just use the first letter of each word (R, W, A).
>
>
<open_mode> determines how the file will be opened. Valid values are READ, WRITE, and APPEND. You may also just use the first letter of each word (R, W, A).
 
Changed:
<
<
<line_termination> identifies how each line will be terminated. Valid values are LF, CR/LF or NONE. This parameter is optional, and if not specified will default to CR/LF for Windows based servers and LF for all other servers. These characters will be added to the end of every line when you write it, or removed from every line when you read it.
>
>
<line_termination> determines how each line will be terminated. Valid values are LF, CR/LF or NONE. This parameter is optional, and if not specified will default to CR/LF for Windows based servers and LF for all other servers. These characters will be added to the end of every line when you write it, or removed from every line when you read it.
  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.

Revision 62012-01-24 - JeanNeron

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

.STREAM OPEN

Line: 27 to 27
  <open_mode> identifies how the file will be opened. Valid values are READ, WRITE, and APPEND. You may also just use the first letter of each word (R, W, A).
Changed:
<
<
<line_termination> identifies how each line will be terminated. Valid values are LF, CR/LF or NONE. This paremeter is optional, and if not specified will default to CR/LF for Windows based servers and LF for all other servers. These characters will be added to the end of every line when you write it, or removed from every line when you read it.
>
>
<line_termination> identifies how each line will be terminated. Valid values are LF, CR/LF or NONE. This parameter is optional, and if not specified will default to CR/LF for Windows based servers and LF for all other servers. These characters will be added to the end of every line when you write it, or removed from every line when you read it.
  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.
Added:
>
>
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.
 

Comments:

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

Revision 52012-01-24 - JeanNeron

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

.STREAM OPEN

Line: 6 to 6
 

Usage:

Changed:
<
<
      PASS        <stream_name>                              SHARE? N
      PASS        <pathname>                                 SHARE? N
      PASS        <open_mode>                                SHARE? N
      PASS        <line_termination>                         SHARE? N

>
>
      PASS         <stream_name>              FIELD            SHARE? N
      PASS         <pathname>                 FIELD            SHARE? N
      PASS         <open_mode>                FIELD            SHARE? N
      PASS         <line_termination>         FIELD            SHARE? N

  GOSUB --- .STREAM OPEN * check for errors IF --- .STREAM OPEN NE
Line: 28 to 29
  <line_termination> identifies how each line will be terminated. Valid values are LF, CR/LF or NONE. This paremeter is optional, and if not specified will default to CR/LF for Windows based servers and LF for all other servers. These characters will be added to the end of every line when you write it, or removed from every line when you read it.
Changed:
<
<
You can open more than one stream file at at time, so long as the <stream_name> is different.
>
>
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.
 
Deleted:
<
<
This subroutine sets a result value in the corresponding results Token field.
 

Comments:

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

Revision 42012-01-23 - JeanNeron

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

.STREAM OPEN

Line: 9 to 9
 
      PASS        <stream_name>                              SHARE? N
      PASS        <pathname>                                 SHARE? N
      PASS        <open_mode>                                SHARE? N

Changed:
<
<
<opt> PASS <line_termination> SHARE? N
>
>
PASS <line_termination> SHARE? N
  GOSUB --- .STREAM OPEN * check for errors IF --- .STREAM OPEN NE

Description:

Changed:
<
<
This subroutine must be passed at least three field. These fields define the nature of the file being processed.
>
>
This subroutine is called to open a file stream. A file stream can point to an actual file on the filesystem, or it can be output from an O/S command (eg, opening a 'pipe' via a file name of "|dir" or "|ls- l").
 
Changed:
<
<
<stream_name> identifies the symbolic name of the stream used to open the file. Passing this parameter is required.
>
>
The first three parameters are required, and the subroutine will CANCEL if they are are not all received. The <line_termination> parameter is optional.

<stream_name> identifies the symbolic name of the stream used to open the file (Required). This can be any name you desire. All subsequent operations on this stream will be via this name.

<pathname> identifies the actual file to be opened (ie, /tmp/appx-registration.txt) or the pipe to be read (ie, "|ls -l /tmp") (Required). If you are opening a file for WRITE or APPEND, Appx will also create the path if necessary.

<open_mode> identifies how the file will be opened. Valid values are READ, WRITE, and APPEND. You may also just use the first letter of each word (R, W, A).

<line_termination> identifies how each line will be terminated. Valid values are LF, CR/LF or NONE. This paremeter is optional, and if not specified will default to CR/LF for Windows based servers and LF for all other servers. These characters will be added to the end of every line when you write it, or removed from every line when you read it.

You can open more than one stream file at at time, so long as the <stream_name> is different.

  This subroutine sets a result value in the corresponding results Token field.

Comments:

Revision 32011-08-18 - PeteBrower

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

.STREAM OPEN

Line: 9 to 9
 
      PASS        <stream_name>                              SHARE? N
      PASS        <pathname>                                 SHARE? N
      PASS        <open_mode>                                SHARE? N

Changed:
<
<
PASS <line_termination> SHARE? N <opt> GOSUB --- .STREAM OPEN
>
>
<opt> PASS <line_termination> SHARE? N GOSUB --- .STREAM OPEN
  * check for errors IF --- .STREAM OPEN NE

Revision 22011-08-17 - PeteBrower

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

.STREAM OPEN

Revision 12011-08-12 - PeteBrower

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

.STREAM OPEN

This subroutine is called to open a file stream.


Usage:

    PASS        <stream_name>                              SHARE? N
    PASS        <pathname>                                 SHARE? N
    PASS        <open_mode>                                SHARE? N
      PASS        <line_termination>                         SHARE? N
<opt> GOSUB   --- .STREAM OPEN
     *       check for errors
    IF      --- .STREAM OPEN              NE

Description:

This subroutine must be passed at least three field. These fields define the nature of the file being processed.

<stream_name> identifies the symbolic name of the stream used to open the file. Passing this parameter is required.

This subroutine sets a result value in the corresponding results Token field.

Comments:

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


<--/commentPlugin-->

-- PeteBrower - 2011-08-12

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