

            trunc (2) --- truncate a file                            02/24/82


            _C_a_l_l_i_n_g _I_n_f_o_r_m_a_t_i_o_n

                 integer function trunc (fd)
                 file_des fd

                 Library:  vswtlb (standard Subsystem library)


            _F_u_n_c_t_i_o_n

                 'Trunc' is used to truncate writeable files at their current
                 position; that is, to delete the remainder of the file.  The
                 argument is the file descriptor of the file to be truncated;
                 the  function return is OK if the truncation was successful,
                 ERR otherwise.


            _I_m_p_l_e_m_e_n_t_a_t_i_o_n

                 'Flush$' is called to empty the buffers associated with  the
                 given  file.  If the file to be truncated is a terminal file
                 or the null device, then an immediate successful  return  is
                 taken.   If  the  file to be truncated is a disk file, it is
                 truncated by the Primos routine PRWF$$.  If the return  from
                 PRWF$$  is good, 'trunc' returns OK; if not, 'trunc' returns
                 ERR.


            _C_a_l_l_s

                 flush$, mapsu, Primos prwf$$


            _B_u_g_s

                 Behavior on terminal files is somewhat questionable.


            _S_e_e _A_l_s_o

                 remove (2), rmtemp (2)

















            trunc (2)                     - 1 -                     trunc (2)


