seek

Section: Tcl Built-In Commands (n)
Updated:
Index Return to Main Contents
 

NAME

seek - Change the access position for an open file  

SYNOPSIS

seek fileId offset ?origin?

 

DESCRIPTION

Change the current access position for fileId. FileId must have been the return value from a previous call to open, or it may be stdin, stdout, or stderr to refer to one of the standard I/O channels. The offset and origin arguments specify the position at which the next read or write will occur for fileId. Offset must be an integer (which may be negative) and origin must be one of the following:

start
The new access position will be offset bytes from the start of the file.
current
The new access position will be offset bytes from the current access position; a negative offset moves the access position backwards in the file.
end
The new access position will be offset bytes from the end of the file. A negative offset places the access position before the end-of-file, and a positive offset places the access position after the end-of-file.

The origin argument defaults to start. This command returns an empty string.

 

KEYWORDS

access position, file, seek


 

Index

NAME
SYNOPSIS
DESCRIPTION
KEYWORDS

This document was created by man2html, using the manual pages.
Time: 20:33:46 GMT, October 05, 2024