List of I/O modes
From the SETL Wiki
The table below contains a summary of all supported I/O modes (i.e valid values for the how parameter to the open primitive) in all known versions of SETL.
Notes:
- Mode names are case-insensitive, although unix-style mode names are shown here in lowercase and others in uppercase.
|
GREEN - GNU SETL only. |
| Recommended mode names | Alternate mode names | Description | Notes |
|---|---|---|---|
| a |
ab |
Stream output at end of file | |
| a+ |
a+b |
Random access read/write, initial position at end of file | |
| IGNORE |
IGNORE-SIGNAL |
No I/O, but blocks the specified signal until closed. |
"path" must be a signal name. See Signal handling in GNU SETL. |
| n |
BINARY-NEW |
Text stream output to new file (fails if the file already exists.) |
Text/binary distinction is irrelevant because these modes are defined only in GNU SETL which has no binary mode (all values are represented as strings.) |
| n+ |
BINARY-DIRECT-NEW |
Create a new file for random read/write access (fails if the file already exists.) | |
| PIPE-FROM | PIPE-IN | Read from command's standard output. | "path" must be a shell command. See also filter and popen. |
| PIPE-TO | PIPE-OUT | Write to command's standard input | |
|
r |
BINARY |
Binary stream input (not human-readable) |
"path" can be an existing file descriptor, e.g. one inherited from the C program that invoked the SETL interpreter. |
|
TEXT-IN |
TEXT |
Text stream input | |
|
r+ |
BINARY-DIRECT |
Random-access read-write; Create if absent; Initially read from the start of the file if it exists. | |
| rw |
BIDIRECTIONAL |
Read/write access, typically a device such as a serial port or named pipe. |
"path" can be an existing file descriptor, e.g. one inherited from the C program that invoked the SETL interpreter. |
| SERVER-SOCKET | TCP-SERVER-SOCKET | TCP server socket | "path" must be a string containing either:
|
| SIGNAL | SIGNAL-IN |
Catch signal; deliver a newline on the input stream whenever the specified signal is received by this process. |
"path" must be a signal name. See Signal handling in GNU SETL. |
| SOCKET |
CLIENT-SOCKET | TCP client socket | "path" must be a string in the form host:port, where host is a hostname or IPV4 address and port is either a decimal port number or service name from /etc/services. |
| TTY-PUMP | LINE-PUMP | Bidirectional pump to child process's standard input and output, via a pseudo-tty | "path" must be a shell command. See also filter and popen. |
|
TEXT-OUT |
CODED-OUT |
Text stream output |
"path" can be an existing file descriptor, e.g. one inherited from the C program that invoked the SETL interpreter. |
|
w |
OUTPUT |
Binary stream output (not human-readable) | |
|
|
Formatted output | ||
| w+ |
w+b |
Random access read/write; Initially create or truncate file. | |
| REAL-MS |
Timer; Deliver a newline on the input stream every N milliseconds. |
The "path" argument must be a string containing the value of N in decimal. |


