FSEEK(3S) UNIX Programmer's Manual FSEEK(3S) NAME fseek, ftell, rewind - reposition a stream SYNOPSIS #include int fseek (stream, offset, ptrname) FILE *stream; long offset; int ptrname; long ftell (stream) FILE *stream; long rewind(stream) FILE *stream; HP-UX COMPATIBILITY Level: HP-UX/RUN ONLY Origin: System III 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 0, 1, or 2. _F_s_e_e_k undoes any effects of _u_n_g_e_t_c(3S). After _f_s_e_e_k or _r_e_w_i_n_d, the next operation on an update file may be either input or output. _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. The offset is measured in bytes on HP-UX; on some other sys- tems, the unit of measure varies, and is 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, 0L, 0). SEE ALSO lseek(2), fopen(3S). DIAGNOSTICS _F_s_e_e_k returns -1 for improper seeks, otherwise zero. _F_t_e_l_l returns -1 for error conditions.