truncate              package:Rstreams              R Documentation

_T_r_u_n_c_a_t_e _a _B_i_n_a_r_y _S_t_r_e_a_m

_D_e_s_c_r_i_p_t_i_o_n:

     Truncates a binary stream at its current position.

_U_s_a_g_e:

       truncate(stream)

_A_r_g_u_m_e_n_t_s:

  stream: a stream previously opened in write mode.

_D_e_t_a_i_l_s:

     This function will truncate the file at the current position.  Any
     data after this position will be deleted.

_V_a_l_u_e:

     The new size of the stream.

_S_e_e _A_l_s_o:

     `openstream'

_E_x_a_m_p_l_e_s:

     s <- openstream("mydata", "write")
     # Write the bytes from 1 to 10 to the file, and truncate after them
     # to be sure it is only 10 bytes long.
     writeint(s, 1:10, 1)
     truncate(s)
     closestream(s)

