FSEEK(3S) UNIX Programmer's Manual FSEEK(3S) NAME fseek, ftell, rewind - reposition a stream SYNOPSIS #include #include #include fseek(stream, offset, ptrname) FILE *stream; long offset; long ftell(stream) FILE *stream; rewind(stream) DESCRIPTION _F_s_e_e_k sets the position of the next input or output opera- tion on the _s_t_r_e_a_m. The new position is at the signed dis- tance _o_f_f_s_e_t bytes from the beginning, the current position, or the end of the file, according as _p_t_r_n_a_m_e has the value FSEEK_ABSOLUTE, FSEEK_RELATIVE, or FSEEK_EOF. _F_s_e_e_k undoes any effects of _u_n_g_e_t_c(3S). _F_t_e_l_l returns the current value of the offset relative to the beginning of the file associated with the named _s_t_r_e_a_m. It is measured in bytes on UNIX; on some other systems it is a magic cookie, and the only foolproof way to obtain an _o_f_f_s_e_t for _f_s_e_e_k. _R_e_w_i_n_d(_s_t_r_e_a_m) is equivalent to _f_s_e_e_k(_s_t_r_e_a_m, _0_L, _F_S_E_E_K__A_B_S_O_L_U_T_E). SEE ALSO lseek(2), fopen(3S) DIAGNOSTICS _F_s_e_e_k returns -1 for improper seeks. Printed 5/16/83 1