.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
      GOSUB   --- .STREAM OPEN
       *       check for errors
      IF      --- .STREAM OPEN              NE

Description:

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").

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:

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


-- PeteBrower - 2011-08-12

Edit | Attach | Watch | Print version | History: r12 | r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r4 - 2012-01-23 - JeanNeron
 
  • Edit
  • Attach
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