seek.n
来自「tcl是工具命令语言」· N 代码 · 共 71 行
N
71 行
'\"'\" Copyright (c) 1993 The Regents of the University of California.'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.'\"'\" See the file "license.terms" for information on usage and redistribution'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.'\" '\" RCS: @(#) $Id: seek.n,v 1.5 2001/09/14 19:20:40 andreas_kupries Exp $'\" .so man.macros.TH seek n 8.1 Tcl "Tcl Built-In Commands".BS'\" Note: do not modify the .SH NAME line immediately below!.SH NAMEseek \- Change the access position for an open channel.SH SYNOPSIS\fBseek \fIchannelId offset \fR?\fIorigin\fR?.BE.SH DESCRIPTION.PPChanges the current access position for \fIchannelId\fR..PP.VS\fIChannelId\fR must be an identifier for an open channel such as aTcl standard channel (\fBstdin\fR, \fBstdout\fR, or \fBstderr\fR),the return value from an invocation of \fBopen\fR or \fBsocket\fR, orthe result of a channel creation command provided by a Tcl extension..VE.PPThe \fIoffset\fR and \fIorigin\fRarguments specify the position at which the next read or write will occurfor \fIchannelId\fR. \fIOffset\fR must be an integer (which may benegative) and \fIorigin\fR must be one of the following:.TP 10\fBstart\fRThe new access position will be \fIoffset\fR bytes from the startof the underlying file or device..TP 10\fBcurrent\fRThe new access position will be \fIoffset\fR bytes from the currentaccess position; a negative \fIoffset\fR moves the access positionbackwards in the underlying file or device..TP 10\fBend\fRThe new access position will be \fIoffset\fR bytes from the end ofthe file or device. A negative \fIoffset\fR places the access positionbefore the end of file, and a positive \fIoffset\fR places the accessposition after the end of file..LPThe \fIorigin\fR argument defaults to \fBstart\fR..PPThe command flushes all buffered output for the channel before the commandreturns, 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 underlyingfile or device does not support seeking..PP.VS 8.1Note that \fIoffset\fR values are byte offsets, not characteroffsets. Both \fBseek\fR and \fBtell\fR operate in terms of bytes,not characters, unlike \fBread\fR..VE 8.1.SH "SEE ALSO"file(n), open(n), close(n), gets(n), tell(n), Tcl_StandardChannels(3) .SH KEYWORDSaccess position, file, seek
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?