Command: open

Syntax

open <channel> {,<mode>}

Description

Open a system input/output channel for communication. This includes opening communication channels to Fire translator Services (i.e. not database services) running on a web server.

Parameters

Switches

Notes

The system numeric free_channel may be used to request an unused channel number.

The <mode> parameter is ignored for both data transfer server and filter process channels, which always use w.

Examples

Open a file for reading.

open chan1,-f=test.dat

Open a file for writing.

open chan2, w, -f=outs

Open a process for reading on the next free channel.

channel myc
open myc, -p='ls -l'

Open a server process on the next free channel.

open myc, -s='dxf_server'

Open a connection to a socket.

open myc,-ip='manta:4999'

Open a connection to a Translation Service running on a Web Server.

open ch,-req='http://www.my_web_server.com/xmarc/Broker?service=ACAD_SERVICE'

Open a listener connection.

open myc, -li=3101

Open a channel to a peer process.

# Start another fire process
numeric port=free_port
string prog = flocal('$MXBIN/'|program)
:^(prog) -netsock=^(port) &
# Open a channel to it
open myc, -peer='localhost:'|ns(port), -tim=10

See Also

Commands:

close, read, write

Identifiers:

async_channel (channel), chan# (channel), free_channel (channel), free_port (numeric)

Structures:

channel.flush, channel.rewind