<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/PT-BR/fileGetPos?action=history&amp;feed=atom</id>
	<title>PT-BR/fileGetPos - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/PT-BR/fileGetPos?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/fileGetPos&amp;action=history"/>
	<updated>2026-04-09T16:53:30Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/fileGetPos&amp;diff=78708&amp;oldid=prev</id>
		<title>Lettify: Created page with &quot;__NOTOC__ {{BR/Funcao compartilhada}}  Retorna a posição atual na leitura/gravação de um determinado arquivo.  ==Sintaxe== &lt;syntaxhighlight lang=&quot;lua&quot;&gt; int fileGetPos ( file theFile ) &lt;/syntaxhighlight&gt;  {{PT-BR/POO||file:getPos|pos|PT-BR/fileSetPos}}  ===Argumentos necessários=== *'''theFile:''' o '''arquivo''' que você deseja obter a posição.  ===Retorna=== Retorna a posição do arquivo, ou ''false'' se tiver ocorrido algum erro (ex.: um '''arquivo''' inv...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/fileGetPos&amp;diff=78708&amp;oldid=prev"/>
		<updated>2023-12-20T18:51:16Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;__NOTOC__ {{BR/Funcao compartilhada}}  Retorna a posição atual na leitura/gravação de um determinado arquivo.  ==Sintaxe== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; int fileGetPos ( file theFile ) &amp;lt;/syntaxhighlight&amp;gt;  {{PT-BR/POO||&lt;a href=&quot;/index.php?title=File&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;File (page does not exist)&quot;&gt;file&lt;/a&gt;:getPos|pos|PT-BR/fileSetPos}}  ===Argumentos necessários=== *&amp;#039;&amp;#039;&amp;#039;theFile:&amp;#039;&amp;#039;&amp;#039; o &amp;#039;&amp;#039;&amp;#039;arquivo&amp;#039;&amp;#039;&amp;#039; que você deseja obter a posição.  ===Retorna=== Retorna a posição do arquivo, ou &amp;#039;&amp;#039;false&amp;#039;&amp;#039; se tiver ocorrido algum erro (ex.: um &amp;#039;&amp;#039;&amp;#039;arquivo&amp;#039;&amp;#039;&amp;#039; inv...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOTOC__&lt;br /&gt;
{{BR/Funcao compartilhada}}&lt;br /&gt;
&lt;br /&gt;
Retorna a posição atual na leitura/gravação de um determinado arquivo.&lt;br /&gt;
&lt;br /&gt;
==Sintaxe==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; int fileGetPos ( file theFile ) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{PT-BR/POO||[[file]]:getPos|pos|PT-BR/fileSetPos}}&lt;br /&gt;
&lt;br /&gt;
===Argumentos necessários===&lt;br /&gt;
*'''theFile:''' o '''arquivo''' que você deseja obter a posição.&lt;br /&gt;
&lt;br /&gt;
===Retorna===&lt;br /&gt;
Retorna a posição do arquivo, ou ''false'' se tiver ocorrido algum erro (ex.: um '''arquivo''' inválido for especificado).&lt;br /&gt;
&lt;br /&gt;
==Exemplo==&lt;br /&gt;
Este exemplo abre o arquivo &amp;quot;test.txt&amp;quot; e exibe o seu conteúdo e a posição de leitura atual no console.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local hFile = fileOpen(&amp;quot;test.txt&amp;quot;, true)       -- tentamos abrir o arquivo (em modo leitura)&lt;br /&gt;
if hFile then                                  -- verificamos se foi aberto com sucesso&lt;br /&gt;
    local buffer&lt;br /&gt;
    while not fileIsEOF(hFile) do              -- desde que não estejamos no fim do arquivo...&lt;br /&gt;
        buffer = fileRead(hFile, 500)          -- ... lemos os próximos 500 bytes ...&lt;br /&gt;
        outputConsole(buffer..&amp;quot;Current Position: &amp;quot;..fileGetPos(hFile))                  -- ... então exibimos o conteúdo desta parte e a posição de leitura atual no console&lt;br /&gt;
    end&lt;br /&gt;
    fileClose(hFile)                           -- fechamos o arquivo depois que terminarmos com ele&lt;br /&gt;
else&lt;br /&gt;
    outputConsole(&amp;quot;Unable to open test.txt&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Veja também==&lt;br /&gt;
{{PT-BR/File functions}}&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
</feed>