2.11BSD/man/cat8/rmt.0
RMT(8) UNIX Programmer's Manual RMT(8)
NAME
rmt - remote magtape protocol module
SYNOPSIS
rmt
DESCRIPTION
_R_m_t is a program used by the remote dump and restore pro-
grams in manipulating a magnetic tape drive through an
interprocess communication connection. _R_m_t is normally
started up with an _r_e_x_e_c(3) or _r_c_m_d(3) call.
The _r_m_t program accepts requests specific to the manipula-
tion of magnetic tapes, performs the commands, then responds
with a status indication. All responses are in ASCII and in
one of two forms. Successful commands have responses of
A_n_u_m_b_e_r\n
where _n_u_m_b_e_r is an ASCII representation of a decimal number.
Unsuccessful commands are responded to with
E_e_r_r_o_r-_n_u_m_b_e_r\n_e_r_r_o_r-_m_e_s_s_a_g_e\n,
where _e_r_r_o_r-_n_u_m_b_e_r is one of the possible error numbers
described in _i_n_t_r_o(2) and _e_r_r_o_r-_m_e_s_s_a_g_e is the corresponding
error string as printed from a call to _p_e_r_r_o_r(3). The pro-
tocol is comprised of the following commands (a space is
present between each token).
O device mode Open the specified _d_e_v_i_c_e using the indicated
_m_o_d_e. _D_e_v_i_c_e is a full pathname and _m_o_d_e is
an ASCII representation of a decimal number
suitable for passing to _o_p_e_n(2). If a device
had already been opened, it is closed before
a new open is performed.
C device Close the currently open device. The _d_e_v_i_c_e
specified is ignored.
L whence offset
Perform an _l_s_e_e_k(2) operation using the
specified parameters. The response value is
that returned from the _l_s_e_e_k call.
W count Write data onto the open device. _R_m_t reads
_c_o_u_n_t bytes from the connection, aborting if
a premature end-of-file is encountered. The
response value is that returned from the
_w_r_i_t_e(2) call.
R count Read _c_o_u_n_t bytes of data from the open
Printed 11/26/99 November 17, 1996 1
RMT(8) UNIX Programmer's Manual RMT(8)
device. If _c_o_u_n_t exceeds the size of the
data buffer (10 kilobytes), it is truncated
to the data buffer size. _R_m_t then performs
the requested _r_e_a_d(2) and responds with
A_c_o_u_n_t-_r_e_a_d\n if the read was successful;
otherwise an error in the standard format is
returned. If the read was successful, the
data read is then sent.
I operation count
Perform a MTIOCOP _i_o_c_t_l(2) command using the
specified parameters. The parameters are
interpreted as the ASCII representations of
the decimal values to place in the _m_t__o_p and
_m_t__c_o_u_n_t fields of the structure used in the
_i_o_c_t_l call. The return value is the _c_o_u_n_t
parameter when the operation is successful.
S Return the status of the open device, as
obtained with a MTIOCGET _i_o_c_t_l call. If the
operation was successful, an ``ack'' is sent
with the size of the status buffer, then the
status buffer is sent (in binary).
Any other command causes _r_m_t to exit.
DIAGNOSTICS
All responses are of the form described above.
SEE ALSO
rcmd(3), rexec(3), mtio(4), rdump(8), rrestore(8)
BUGS
People tempted to use this for a remote file access protocol
are discouraged.
Printed 11/26/99 November 17, 1996 2