t3x.org / t3x / t3x-manual / 343.html
 
T3X - A Minimum Procedural Language
Version 8.1.5, Online Edition
Copyright(C) 1996-2004
Nils M Holm
 
Previous:
3.4.2 CLOSE
TOC | Index | Back Next:
3.4.4 EOF

3.4.3 CREATE

ios.CREATE(fd, buffer, len, mode) ! Fdesc,Bvec,Num,Num => 0

Initialize the iostream 'ios' with the given parameters. 'Fd' is an open file descriptor which will be associated with the stream. 'Buffer' will be used for buffering read/write operations on the stream. 'Len' specifies the size of 'buffer' in bytes. 'Mode' controls the operations allowed on 'ios'. The following flags may be used to build the mode value (by OR'ing together the values):

Mode constant ReadOK WriteOK LF>CRLF CRLF>LF Pos
IOSTREAM.FREAD Yes No - - 0
IOSTREAM.FWRITE No Yes - - 0
IOSTREAM.FRDWR Yes Yes - - 0
IOSTREAM.FAPPND Yes Yes - - EOF
IOSTREAM.FKILLCR - - - Yes -
IOSTREAM.FADDCR - - Yes - -
IOSTREAM.FTRANS - - Yes Yes -

CRLF>LF denotes that each CR character found in an input stream will be silently discarded. This is useful when reading DOS-style ASCII text files. LF>CRLF means that a CR character will be added before each LF in the output stream. Since IOSTREAM.FADDCR has no effect on input and IOSTREAM.FKILLCR has no effect on output, IOSTREAM.FTRANS may be used safely on input as well as output streams. Pos denotes the initial position of the file pointer. IOSTREAM.FAPPND is similar to IOSTREAM.FRDWR, but positions the pointer at the EOF, so that output will be appended to the associated file.

CREATE merely initializes an IOSTREAM object with the supplied parameters. It cannot fail and therefore, it returns always 0.

When using CREATE to create a stream for accessing standard file descriptors (such as T3X.SYSIN and T3X.SYSOUT), these streams should never be closed. IOS.FLUSH may be used to synchronize them.

See also: OPEN, CLOSE, FLUSH

Previous:
3.4.2 CLOSE
TOC | Index | Back Next:
3.4.4 EOF