seek(n) Tcl Built-In Commands seek(n) _________________________________________________________________ NAME seek - Change the access position for an open channel SYNOPSIS seek _c_h_a_n_n_e_l_I_d _o_f_f_s_e_t ?_o_r_i_g_i_n? _________________________________________________________________ DESCRIPTION Changes the current access position for _c_h_a_n_n_e_l_I_d. _C_h_a_n_- _n_e_l_I_d must be a channel identifier such as returned from a previous invocation of open or socket. The _o_f_f_s_e_t and _o_r_i_- _g_i_n arguments specify the position at which the next read or write will occur for _c_h_a_n_n_e_l_I_d. _O_f_f_s_e_t must be an integer (which may be negative) and _o_r_i_g_i_n must be one of the fol- lowing: start The new access position will be _o_f_f_s_e_t bytes from the start of the underlying file or device. current The new access position will be _o_f_f_s_e_t bytes from the current access position; a negative _o_f_f_s_e_t moves the access position backwards in the under- lying file or device. end The new access position will be _o_f_f_s_e_t bytes from the end of the file or device. A negative _o_f_f_s_e_t places the access position before the end of file, and a positive _o_f_f_s_e_t places the access position after the end of file. The _o_r_i_g_i_n argument defaults to start. The command flushes all buffered output for the channel before the command returns, even if the channel is in non- blocking mode. It also discards any buffered and unread input. This command returns an empty string. An error occurs if this command is applied to channels whose underly- ing file or device does not support seeking. KEYWORDS access position, file, seek Tcl Last change: 7.5 1