<doc>
	<legacy_id>1572</legacy_id>
	<name>seek</name>
	<type>command</type>

	<syntax>
		<example>seek {to | rel[ative]} <i>byteNumber</i> in file <i>filePath</i></example>
	</syntax>

	<synonyms>
	</synonyms>

	<summary>Locates a position in a <keyword tag="file">file</keyword>, to be used by the <command tag="read from file">read from file</command> and <command tag="write to file">write to file</command> <glossary tag="command">commands</glossary>.</summary>

	<examples>
<example>seek to 100 in file "test.txt"</example>
<example>seek relative -10 in file "test.txt"</example>
<example><p>put specialFolderPath("desktop")  &amp; "/test.txt" into tFile</p><p>open file tFile for write</p><p>write "123456789--" to file tFile</p><p>seek to 9 in file tFile</p><p>write "10" to file tFile</p><p>close file tFile</p></example>
	</examples>

	<history>
		<introduced version="1.0">Added.</introduced>
		<deprecated version=""></deprecated>
		<removed version=""></removed>
		
		<experimental version=""></experimental>
		<nonexperimental version=""></nonexperimental>
	</history>

	<objects>
	</objects>

	<platforms>
		<mac/>
		<windows/>
		<linux/>
		<ios/>
		<android/>
	</platforms>

	<classes>
		<desktop/>
		<server/>
		<web/>
		<mobile/>
	</classes>

	<security>
	</security>


	<classification>
		<category>Files, Folders, &amp; Resources</category>
	</classification>

	<references>
		<command tag="close file">close file Command</command>
		<keyword tag="relative">relative Keyword</keyword>
	</references>

	<description>Use the <b>seek</b> <glossary tag="command">command</glossary> to prepare to read from or write to an open <keyword tag="file">file</keyword> at a specific position in the <keyword tag="file">file</keyword>.<p></p><p><b>Parameters:</b></p><p>The <i>byteNumber</i> is an <keyword tag="integer">integer</keyword> representing the position in the <keyword tag="file">file</keyword>.</p><p></p><p>The <i>filePath</i> specifies the <glossary tag="file path">name and location</glossary> of the <keyword tag="file">file</keyword> you want to seek in. It must be the same as the <glossary tag="file path">path</glossary> you used with the <command tag="open file">open file</command> command. The <i>filePath</i> is case-sensitive, even on <glossary tag="platform">platforms</glossary> where file names are not case-sensitive.</p><p></p><p><b>Comments:</b></p><p>The next <b>read from file</b> or <command tag="write to file">write to file</command> <glossary tag="command">command</glossary> will start reading or writing at the position specified by the <b>seek</b> <glossary tag="command">command</glossary>.</p><p></p><p>Theform sets the file position to <i>byteNumber</i> <glossary tag="byte">bytes</glossary> from the start of the <keyword tag="file">file</keyword>. Theform sets the file position to <i>byteNumber</i> <glossary tag="byte">bytes</glossary> from the current position. The position is set by either a previous <b>seek</b> <glossary tag="command">command</glossary>, or a <command tag="read from file">read from file</command> or <command tag="write to file">write to file</command> <glossary tag="command">command</glossary>.</p></description>
</doc>