Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > bd5c3d824c3db63ffd9226c15941e6ad > files > 2003

mozart-1.4.0-1mdv2010.0.i586.rpm

<HTML><HEAD><TITLE>Tcl Built-In Commands - seek manual page</TITLE></HEAD><BODY>
<H3><A NAME="M2">NAME</A></H3>
seek - Change the access position for an open channel
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>seek </B><I>channelId offset </I>?<I>origin</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
Changes the current access position for <I>channelId</I>.
<I>ChannelId</I> must be a channel identifier such as returned from a
previous invocation of <B><A HREF="../TclCmd/open.htm">open</A></B> or <B><A HREF="../TclCmd/socket.htm">socket</A></B>.
The <I>offset</I> and <I>origin</I>
arguments specify the position at which the next read or write will occur
for <I>channelId</I>. <I>Offset</I> must be an integer (which may be
negative) and <I>origin</I> must be one of the following:
<P>
<DL>
<P><DT><A NAME="M5"><B>start</B></A><DD>
The new access position will be <I>offset</I> bytes from the start
of the underlying file or device.
<P><DT><A NAME="M6"><B>current</B></A><DD>
The new access position will be <I>offset</I> bytes from the current
access position; a negative <I>offset</I> moves the access position
backwards in the underlying file or device.
<P><DT><A NAME="M7"><B>end</B></A><DD>
The new access position will be <I>offset</I> bytes from the end of
the file or device.  A negative <I>offset</I> places the access position
before the end of file, and a positive <I>offset</I> places the access
position after the end of file.
<P></DL>
<P>
The <I>origin</I> argument defaults to <B>start</B>.
<P>
The command flushes all buffered output for the channel before the command
returns, even if the channel is in nonblocking 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 underlying
file or device does not support seeking.

<H3><A NAME="M8">KEYWORDS</A></H3>
<A href="../Keywords/A.htm#access position">access position</A>, <A href="../Keywords/F.htm#file">file</A>, <A href="../Keywords/S.htm#seek">seek</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1993 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>