<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/PT-BR/fileClose?action=history&amp;feed=atom</id>
	<title>PT-BR/fileClose - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/PT-BR/fileClose?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/fileClose&amp;action=history"/>
	<updated>2026-04-17T23:07:22Z</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/fileClose&amp;diff=78691&amp;oldid=prev</id>
		<title>Lettify: Created page with &quot;__NOTOC__ {{BR/Funcao compartilhada}} Fecha um '''arquivo''' obtido por fileCreate ou fileOpen.  ==Sintaxe== &lt;syntaxhighlight lang=&quot;lua&quot;&gt; bool fileClose ( file theFile ) &lt;/syntaxhighlight&gt; {{PT-BR/POO||file:close}}  ===Argumentos necessários=== *'''theFile:''' O '''arquivo''' que quer fechar.  ===Retorno=== Retorna ''true'' se o arquivo tiver sido fechado com sucesso, ''false'' caso contrário.  ==Exemplo== Este exemplo cria u...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/fileClose&amp;diff=78691&amp;oldid=prev"/>
		<updated>2023-12-20T17:24:32Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;__NOTOC__ {{BR/Funcao compartilhada}} Fecha um &amp;#039;&amp;#039;&amp;#039;arquivo&amp;#039;&amp;#039;&amp;#039; obtido por &lt;a href=&quot;/wiki/PT-BR/fileCreate&quot; title=&quot;PT-BR/fileCreate&quot;&gt;fileCreate&lt;/a&gt; ou &lt;a href=&quot;/wiki/PT-BR/fileOpen&quot; title=&quot;PT-BR/fileOpen&quot;&gt;fileOpen&lt;/a&gt;.  ==Sintaxe== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; bool fileClose ( 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;:close}}  ===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 quer fechar.  ===Retorno=== Retorna &amp;#039;&amp;#039;true&amp;#039;&amp;#039; se o arquivo tiver sido fechado com sucesso, &amp;#039;&amp;#039;false&amp;#039;&amp;#039; caso contrário.  ==Exemplo== Este exemplo cria u...&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;
Fecha um '''arquivo''' obtido por [[PT-BR/fileCreate|fileCreate]] ou [[PT-BR/fileOpen|fileOpen]].&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 fileClose ( file theFile )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{PT-BR/POO||[[file]]:close}}&lt;br /&gt;
&lt;br /&gt;
===Argumentos necessários===&lt;br /&gt;
*'''theFile:''' O '''arquivo''' que quer fechar.&lt;br /&gt;
&lt;br /&gt;
===Retorno===&lt;br /&gt;
Retorna ''true'' se o arquivo tiver sido fechado com sucesso, ''false'' caso contrário.&lt;br /&gt;
&lt;br /&gt;
==Exemplo==&lt;br /&gt;
Este exemplo cria um arquivo de texto e escreve um pequeno texto nele.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local newFile = fileCreate(&amp;quot;test.txt&amp;quot;)                -- tento criar um arquivo&lt;br /&gt;
if newFile then                                       -- verifico se o arquivo foi criado com sucesso&lt;br /&gt;
    fileWrite(newFile, &amp;quot;This is a test file!&amp;quot;)        -- escreve uma linha de texto&lt;br /&gt;
    fileClose(newFile)                                -- fecho o arquivo assim que terminar de trabalhar nele&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
É importante lembrar de fechar o arquivo assim que você tiver terminado de trabalhar nele, especialmente se você tiver escrito algum texto no arquivo. Se você não fechar e o resource travar de alguma forma, todas as mudanças no arquivo poderão ser perdidas.&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>