showConnections             package:base             R Documentation

_D_i_s_p_l_a_y _C_o_n_n_e_c_t_i_o_n_s

_D_e_s_c_r_i_p_t_i_o_n:

     Display aspects of connections.

_U_s_a_g_e:

     showConnections(all=FALSE)
     getConnection(what)
     closeAllConnections()

     stdin()
     stdout()
     stderr()

_A_r_g_u_m_e_n_t_s:

     all: logical: if true all connections, including closed ones and
          the standard ones are displayed. If false only open
          user-created connections are included.

    what: integer: a row number of the table given by
          'showConnections'.

_D_e_t_a_i_l_s:

     'stdin()', 'stdout()' and 'stderr()' are standard connections
     corresponding to input, output and error on the console
     respectively (and not necessarily to file streams).  They are
     text-mode connections of class '"terminal"' which cannot be opened
     or closed, and are read-only, write-only and write-only
     respectively. The 'stdout()' and 'stderr()' connections can be
     re-directed by 'sink'.

     'showConnections' returns a matrix of information.  If a
     connection object has been lost or forgotten, 'getConnection' will
     take a row number from the table and return a connection object
     for that connection, which can be used to close the connection,
     for example.

     'closeAllConnections' closes (and destroys) all open user
     connections, restoring all 'sink' diversions as it does so.

_V_a_l_u_e:

     'stdin()', 'stdout()' and 'stderr()' return connection objects.

     'showConnections' returns a character matrix of information with a
     row for each connection, by default only for open non-standard
     connections.

     'getConnection' returns a connection object, or 'NULL'.

_S_e_e _A_l_s_o:

     'connections'

_E_x_a_m_p_l_e_s:

     showConnections(all = TRUE)

     textConnection(letters)
     # oops, I forgot to record that one
     showConnections()
     #  class     description      mode text   isopen   can read can write
     #3 "letters" "textConnection" "r"  "text" "opened" "yes"    "no"     
     ## Not run: close(getConnection(3))

     showConnections()

