openInOut "fff" opens an input output file whose filename is
fff.
openInOut "!cmd" opens an input output file which corresponds to a pipe receiving the output from the shell command
cmd.
openInOut "$hostname:service"opens an input output file by connecting to the specified service port at the specified host.
openInOut "$:service" opens an input output file by listening to the specified service port on the local host, and waiting for an incoming connection.
openInOut "$hostname" opens an input output file by connecting to the Macaulay2 service port (2500) at the specified host.
openInOut "$" opens an input output file by listening to the Macaulay2 service port (2500) on the local host, and waiting for an incoming connection.
openInOut f opens an input output file by accepting a connection to the listener
f, previously created with
openListener.
In order to open a socket successfully, there must be a process accepting connections for the desired service on the specified host.
Socket connections are not available on Sun computers, because Sun doesn't provide static versions of crucial libraries dealing with network communications, or the static version doesn't provide network name service for looking up hostnames.
The various forms listed above can be used also with all other input output operations that open files, such as
openIn,
openOut,
get, and
<<, with data transfer possible only in the direction specified. The only subtlety is that with
openIn "!foo" the standard input of the command
foo is closed, but with
openOut "!foo" the standard output of the command
foo is connected to the standard output of the parent Macaulay2 process.