[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Opens sequential or socket I/O devices and files and associates them with a numeric FreeM input/output channel.
Syntax (Sequential Files)
|
Opens filename for reading and/or writing, and associates the file with FreeM I/O channel channel, provided that the optional postcondition is true or omitted. The below table lists the valid options for access-mode:
r
Read-only access
w
Create a new file for write access
a
Write access; append to existing file
r+
Read/write access
|
If channel was already OPEN
ed in the current process, calling OPEN
on the same channel again implicitly closes the file or device currently associated with channel.
Syntax (Network Sockets)
Network sockets use a dedicated range of FreeM I/O channels ranging from 100-255. OPEN
ing a socket I/O channel does not implicitly connect the socket. Connecting the socket to the specified remote host is accomplished by the /CONNECT
control mnemonic supplied to the USE
command.
OPEN:postcondition socket-channel:"hostname-or-address:port:address-family:connection-type" |
Socket Parameters
The socket I/O channel to use. This must be in the range of 100-255.
The hostname or IP address to connect to. If a hostname is supplied, OPEN
will implictly do a name lookup, the mechanism of which is typically determined by the configuration of /etc/nsswitch.conf
on most UNIX and UNIX-like platforms.
The TCP or UDP port to which the socket will connect on the remote host.
The address family to use. Either IPV4 or IPV6.
Which connection type to use. Either TCP or UDP.
If you do not specify the address family and connection type, they will default to IPV4 and TCP, respectively.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated by root on October 14, 2020 using texi2html 1.82.