<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/Modules/FileSystem/file/flush?action=history&amp;feed=atom</id>
	<title>Modules/FileSystem/file/flush - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/Modules/FileSystem/file/flush?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/file/flush&amp;action=history"/>
	<updated>2026-04-07T04:26:03Z</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=Modules/FileSystem/file/flush&amp;diff=73758&amp;oldid=prev</id>
		<title>Danilo at 03:13, 23 January 2022</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/file/flush&amp;diff=73758&amp;oldid=prev"/>
		<updated>2022-01-23T03:13:06Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 03:13, 23 January 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;pageclass class=&quot;#3cc882&quot; subcaption=&quot;File function&quot;&gt;&amp;lt;/pageclass&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;__NOTOC__&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;__NOTOC__&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This function writes all temporary buffers of a file/stream object into the output storage. This feature shall be interpreted as a hint, not a necessity. Implementations do not have to support this feature.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This function writes all temporary buffers of a file/stream object into the output storage. This feature shall be interpreted as a hint, not a necessity. Implementations do not have to support this feature.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-73675:rev-73758 --&gt;
&lt;/table&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/file/flush&amp;diff=73675&amp;oldid=prev</id>
		<title>Danilo: Created page with &quot;__NOTOC__ This function writes all temporary buffers of a file/stream object into the output storage. This feature shall be interpreted as a hint, not a necessity. Implementations do not have to support this feature.  ==Syntax== &lt;syntaxhighlight lang=&quot;lua&quot;&gt; boolean file:flush () &lt;/syntaxhighlight&gt;  ==Returns== Returns '''true''' if the file/stream has been successfully flushed, '''false''' otherwise.  ==Example== &lt;section name=&quot;Client&quot; class=&quot;client&quot; show=&quot;true&quot;&gt; This sn...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/file/flush&amp;diff=73675&amp;oldid=prev"/>
		<updated>2022-01-19T03:48:33Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;__NOTOC__ This function writes all temporary buffers of a file/stream object into the output storage. This feature shall be interpreted as a hint, not a necessity. Implementations do not have to support this feature.  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; boolean file:flush () &amp;lt;/syntaxhighlight&amp;gt;  ==Returns== Returns &amp;#039;&amp;#039;&amp;#039;true&amp;#039;&amp;#039;&amp;#039; if the file/stream has been successfully flushed, &amp;#039;&amp;#039;&amp;#039;false&amp;#039;&amp;#039;&amp;#039; otherwise.  ==Example== &amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt; This sn...&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;
This function writes all temporary buffers of a file/stream object into the output storage. This feature shall be interpreted as a hint, not a necessity. Implementations do not have to support this feature.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
boolean file:flush ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns '''true''' if the file/stream has been successfully flushed, '''false''' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This snippet writes a text into a file and flushes its buffers, while the file handle is being kept alive as a global. The MTA:Eir FileSystem implementation is encouraged to make sure that the data is written to the harddisk.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Open a text file to store something into.&lt;br /&gt;
local textFile = fileCreate( &amp;quot;my_poem.txt&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
-- Write a nice poem.&lt;br /&gt;
textFile:write(&lt;br /&gt;
[[Roses are red,&lt;br /&gt;
Violets are blue,&lt;br /&gt;
Blueberries are sweet,&lt;br /&gt;
Cupcakes are too.]]&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
-- At this point, the implementation does not have to write the buffers into the textfile.&lt;br /&gt;
-- If delayed, the text file will be empty if opened by an external editor.&lt;br /&gt;
&lt;br /&gt;
-- Make sure the world knows about our poem.&lt;br /&gt;
textFile:flush();&lt;br /&gt;
&lt;br /&gt;
-- Now the text-file should be filled with the data. The MTA:Eir FileSystem implementation has&lt;br /&gt;
-- support for buffer flushing, so the flush method should always return true if used with raw files.&lt;br /&gt;
&lt;br /&gt;
-- We do not want to loose the grip to our lovely poem, so lets keep it alive, forever. &amp;lt;3&lt;br /&gt;
_G.poemFile = textFile;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/file/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
</feed>