<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/PT-BR/fileIsEOF?action=history&amp;feed=atom</id>
	<title>PT-BR/fileIsEOF - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/PT-BR/fileIsEOF?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/fileIsEOF&amp;action=history"/>
	<updated>2026-04-06T07:21:42Z</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/fileIsEOF&amp;diff=78712&amp;oldid=prev</id>
		<title>Lettify: Created page with &quot;__NOTOC__ {{BR/Funcao compartilhada}}  Verifica se a posição atual no arquivo está no fim dele.  {{BR/Nota|Devido às restrições subjacentes da API C, esta função pode retornar '''false''' até que seja feita uma tentativa de leitura além do final do arquivo.}}  ==Sintaxe== &lt;syntaxhighlight lang=&quot;lua&quot;&gt; bool fileIsEOF ( file theFile ) &lt;/syntaxhighlight&gt;  {{PT-BR/POO||file:isEOF|eof}}  ===Argumentos necessários=== *'''theFile:''' O '''arquivo''' que você quer...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/fileIsEOF&amp;diff=78712&amp;oldid=prev"/>
		<updated>2023-12-20T19:04:03Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;__NOTOC__ {{BR/Funcao compartilhada}}  Verifica se a posição atual no arquivo está no fim dele.  {{BR/Nota|Devido às restrições subjacentes da API C, esta função pode retornar &amp;#039;&amp;#039;&amp;#039;false&amp;#039;&amp;#039;&amp;#039; até que seja feita uma tentativa de leitura além do final do arquivo.}}  ==Sintaxe== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; bool fileIsEOF ( 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;:isEOF|eof}}  ===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ê quer...&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;
Verifica se a posição atual no arquivo está no fim dele.&lt;br /&gt;
&lt;br /&gt;
{{BR/Nota|Devido às restrições subjacentes da API C, esta função pode retornar '''false''' até que seja feita uma tentativa de leitura além do final do arquivo.}}&lt;br /&gt;
&lt;br /&gt;
==Sintaxe==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool fileIsEOF ( file theFile )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{PT-BR/POO||[[file]]:isEOF|eof}}&lt;br /&gt;
&lt;br /&gt;
===Argumentos necessários===&lt;br /&gt;
*'''theFile:''' O '''arquivo''' que você quer verificar.&lt;br /&gt;
&lt;br /&gt;
===Retorno===&lt;br /&gt;
Retorna '''true''' se a posição do arquivo especificado está no final do mesmo, '''false''' caso contrário.&lt;br /&gt;
&lt;br /&gt;
==Exemplo==&lt;br /&gt;
This example opens the file test.txt and outputs its contents to the 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)                  -- ... e exibimos 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;
Quando você abre um arquivo, a posição do cursor de leitura/gravação é definida para o início do arquivo. Cada chamada para [[PT-BR/fileRead|fileRead]] ou [[PT-BR/fileWrite|fileWrite]] avança essa posição para a quantidade de bytes que forem lidos/gravados. Esta forma, usando [[PT-BR/fileIsEOF|fileIsEOF]] você pode verificar se você passou por todo o arquivo durante essas execuções.&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>