Functions related to Erlang ports.
Makes a synchronous call to the port
and returns its reply as a term
Closes the port
Sends data
to the port driver port
Associates the port
identifier with a pid
Sends a synchronous control command to the port
and returns its reply as a binary
Returns information about the port
or nil
if the port is closed
Returns information about the port
or nil
if the port is closed
Returns a list of the ports for the current node
Opens an Erlang port given a tuple name
and a list of settings
name :: {:spawn, charlist | binary} | {:spawn_driver, charlist | binary} | {:spawn_executable, charlist | atom} | {:fd, non_neg_integer, non_neg_integer}
call(port, integer, term) :: term
Makes a synchronous call to the port
and returns its reply as a term.
Not all port drivers support this control feature.
For more information, see :erlang.port_call/3
.
Inlined by the compiler.
close(port) :: true
Closes the port
.
For more information, see :erlang.port_close/1
.
Inlined by the compiler.
command(port, iodata, [:force | :nosuspend]) :: boolean
Sends data
to the port driver port
.
For more information, see :erlang.port_command/2
.
Inlined by the compiler.
connect(port, pid) :: true
Associates the port
identifier with a pid
.
For more information, see :erlang.port_connect/2
.
Inlined by the compiler.
control(port, integer, iodata) :: iodata | binary
Sends a synchronous control command to the port
and returns its reply as a binary.
Not all port drivers support this feature.
For more information, see :erlang.port_control/3
.
Inlined by the compiler.
Returns information about the port
or nil
if the port is closed.
For more information, see :erlang.port_info/1
.
info(port, atom) :: {atom, term} | nil
Returns information about the port
or nil
if the port is closed.
For more information, see :erlang.port_info/2
.
list() :: [port]
Returns a list of the ports for the current node.
For more information, see :erlang.ports/0
.
Inlined by the compiler.
open(name, list) :: port
Opens an Erlang port given a tuple name
and a list of settings
.
The supported values for name
are:
{:spawn, command}
- to run an external program. The first space separated word of command
will be considered as the name of the program to run, so use {:spawn_executable, command}
to run a program having spaces in its name. {:spawn_driver, command}
- similar to {:spawn, command}
, but to run a loaded driver. {:spawn_executable, filename}
- similar to {:spawn, filename}
, but to run an external executable. With this option, filename
in its whole is considered the name of the program to execute. {:fd, fd_in, fd_out}
- to access file descriptors used by Erlang, fd_in
being used for standard input, fd_out
for standard output. For more information, see :erlang.open_port/2
.
Inlined by the compiler.
© 2012–2017 Plataformatec
Licensed under the Apache License, Version 2.0.
https://hexdocs.pm/elixir/1.3.3/Port.html