FSEEK(3S) FSEEK(3S) NAME fseek, ftell, rewind - reposition a stream SYNOPSIS #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 operation on the _s_t_r_e_a_m. The new position is at the signed distance _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 0, 1, or 2. _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 fool‐ proof 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, 0L, 0). SEE ALSO lseek(2), fopen(3S) DIAGNOSTICS _F_s_e_e_k returns -1 for improper seeks, otherwise zero. 7th Edition February 24, 1986 FSEEK(3S)