<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://avisynth.nl/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://avisynth.nl/index.php?action=history&amp;feed=atom&amp;title=WriteFile</id>
		<title>WriteFile - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://avisynth.nl/index.php?action=history&amp;feed=atom&amp;title=WriteFile"/>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php?title=WriteFile&amp;action=history"/>
		<updated>2026-04-07T17:54:26Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.24</generator>

	<entry>
		<id>http://avisynth.nl/index.php?title=WriteFile&amp;diff=12762&amp;oldid=prev</id>
		<title>Reel.Deal: add link to avs+ documentation</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php?title=WriteFile&amp;diff=12762&amp;oldid=prev"/>
				<updated>2022-09-18T04:47:24Z</updated>
		
		<summary type="html">&lt;p&gt;add link to avs+ documentation&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 04:47, 18 September 2022&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&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 class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;div {{BlueBox2|40|0|3px solid purple}} &amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;{{AvsPlusFullname}}&amp;lt;br&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Up-to-date documentation: [https://avisynthplus.readthedocs.io/en/latest/avisynthdoc/corefilters/write.html https://avisynthplus.readthedocs.io]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{Func4Def&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{Func4Def&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;|WriteFile(clip ''clip'', string ''filename'', string ''expression1'' [, string ''expression2'' [, ...]] [, bool ''append'', bool ''flush''])&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;|WriteFile(clip ''clip'', string ''filename'', string ''expression1'' [, string ''expression2'' [, ...]] [, bool ''append'', bool ''flush''])&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Reel.Deal</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php?title=WriteFile&amp;diff=8761&amp;oldid=prev</id>
		<title>Raffriff42: formatting, links, phrasing</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php?title=WriteFile&amp;diff=8761&amp;oldid=prev"/>
				<updated>2016-02-28T11:01:27Z</updated>
		
		<summary type="html">&lt;p&gt;formatting, links, phrasing&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 11:01, 28 February 2016&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&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 class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Template:&lt;/del&gt;Func4Def|WriteFile(clip ''clip'', string ''filename'', string ''expression1'' [, string ''expression2'' [, ...]] [, bool ''append'', bool ''flush''])|WriteFileIf(clip ''clip'', string ''filename'', string ''expression1'' [, string ''expression2'' [, ...]] [, bool ''append'', bool ''flush''])|WriteFileStart(clip ''clip'', string ''filename'', string ''expression1'' [, string ''expression2'' [, ...]] [, bool ''append''])|WriteFileEnd(clip ''clip'', string ''filename'', string ''expression1'' [, string ''expression2'' [, ...]] [, bool ''append''])}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{Func4Def&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;|WriteFile(clip ''clip'', string ''filename'', string ''expression1'' [, string ''expression2'' [, ...]] [, bool ''append'', bool ''flush''])&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;|WriteFileIf(clip ''clip'', string ''filename'', string ''expression1'' [, string ''expression2'' [, ...]] [, bool ''append'', bool ''flush''])&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;|WriteFileStart(clip ''clip'', string ''filename'', string ''expression1'' [, string ''expression2'' [, ...]] [, bool ''append''])&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;|WriteFileEnd(clip ''clip'', string ''filename'', string ''expression1'' [, string ''expression2'' [, ...]] [, bool ''append''])&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''WriteFile''' and related functions evaluate each [[Grammar|''expression'']], convert the result to a string and put the concatenated results into a file, followed by a newline. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''WriteFile''' and related functions evaluate each [[Grammar|''expression'']], convert the result to a string and put the concatenated results into a file, followed by a newline. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;*'''WriteFile''' evaluates the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;''&lt;/del&gt;expression&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;''&lt;/del&gt;s and generates output for each frame rendered by the filter.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;*'''WriteFile''' evaluates the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;{{FuncArg|&lt;/ins&gt;expression&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;}}&lt;/ins&gt;s and generates output for each frame rendered by the filter.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;*'''WriteFileIf''' is similar, but generates output only if the first expression &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;is &lt;/del&gt;''true''. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;*'''WriteFileIf''' is similar, but generates output only if the first expression &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;evaluates to&amp;#160; &lt;/ins&gt;''true''. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;:* In both cases, there is no output at script opening or closure. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;:* In both cases, there is no output at script opening or closure. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;:* Note that with [[ScriptClip]], script opening and closure occurs on every frame. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;:* Note that with [[ScriptClip]], script opening and closure occurs on every frame. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 19:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;:* The ''expression''s are evaluated exactly once, at the location of the filter in the script.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;:* The ''expression''s are evaluated exactly once, at the location of the filter in the script.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;*When ''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;append = &lt;/del&gt;true'', the results will be appended to any existing file &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;''&lt;/del&gt;filename&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;''&lt;/del&gt;; if ''false'', a new file is created and the old one is overwritten. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;*When &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;{{FuncArg|append}}=&lt;/ins&gt;''true'', the results will be appended to any existing file &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;{{FuncArg|&lt;/ins&gt;filename&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;}}&lt;/ins&gt;; if ''false'', a new file is created and the old one is overwritten. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;:* Only script opening and closure are affected; '''WriteFile''' and '''WriteFileIf''' per-frame execution ''always'' append. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;:* Only script opening and closure are affected; '''WriteFile''' and '''WriteFileIf''' per-frame execution ''always'' append. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;:* The default for &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;''&lt;/del&gt;append&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'' &lt;/del&gt;is ''true'', except for '''WriteFileStart''', where it is ''false''. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;:* The default for &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;{{FuncArg|&lt;/ins&gt;append&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;}} &lt;/ins&gt;is ''true'', except for '''WriteFileStart''', where it is ''false''. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;*When &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;''&lt;/del&gt;flush = true'', after each operation a 'flush' is performed: any unwritten data is written to disk, and the file is closed and reopened. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;*When &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;{{FuncArg|&lt;/ins&gt;flush&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;}}&lt;/ins&gt;=&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''&lt;/ins&gt;true'', after each operation a &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/ins&gt;'flush&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/ins&gt;' is performed: any unwritten data is written to disk, and the file is closed and reopened. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;:* After flushing you may read the updated file immediately, either through [[ConditionalReader]] or an external application. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;:* After flushing you may read the updated file immediately, either through [[ConditionalReader]] or an external application. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;:* The default for &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;''&lt;/del&gt;flush&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'' &lt;/del&gt;is ''true'' for '''WriteFile''' and '''WriteFileIf''' and ''always'' true (no user option) for '''WriteFileStart''' and '''WriteFileEnd'''. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;:* The default for &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;{{FuncArg|&lt;/ins&gt;flush&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;}} &lt;/ins&gt;is ''true'' for '''WriteFile''' and '''WriteFileIf''' and ''always'' true (no user option) for '''WriteFileStart''' and '''WriteFileEnd'''. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;:* Note that flushing after every frame may be significantly slower.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;:* Note that flushing after every frame may be significantly slower.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;*The [[Runtime_environment#Special_runtime_variables_and_functions|run-time variable]] ''current_frame'' is set so that you can use it in &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;''&lt;/del&gt;expression&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;''&lt;/del&gt;s (as with [[ScriptClip#ScriptClip|ScriptClip]]).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;*The [[Runtime_environment#Special_runtime_variables_and_functions|run-time variable]] ''current_frame'' is set so that you can use it in &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;{{FuncArg|&lt;/ins&gt;expression&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;}}&lt;/ins&gt;s (as with [[ScriptClip#ScriptClip|ScriptClip]]).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;:* ''current_frame'' is set to ''-1'' when the script is loaded and to ''-2'' when the script is closed.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;:* ''current_frame'' is set to ''-1'' when the script is loaded and to ''-2'' when the script is closed.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;hr&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;----&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;div style=&amp;quot;max-width:62em&amp;quot; &lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Usage is best explained with some simple examples:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Usage is best explained with some simple examples:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;div {{BoxWidthIndent|58|0}} &amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; filename = &amp;quot;c:\myprojects\output.txt&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; filename = &amp;quot;c:\myprojects\output.txt&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; # create a test video to get frames&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; # create a test video to get frames&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 42:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 50:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; # and this when the script is closed&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; # and this when the script is closed&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; WriteFileEnd(filename, &amp;quot;&amp;quot;&amp;quot; &amp;quot;Now the script was closed&amp;quot; &amp;quot;&amp;quot;&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; WriteFileEnd(filename, &amp;quot;&amp;quot;&amp;quot; &amp;quot;Now the script was closed&amp;quot; &amp;quot;&amp;quot;&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Look how you can use triple-quotes to type a string &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;in &lt;/del&gt;a string! If the expression cannot be evaluated, the error message is written instead. In case this happens with the If-expression in WriteFileIf the result is assumed to be true.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Look how you can use triple-quotes to type a string &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;inside &lt;/ins&gt;a string! If the expression cannot be evaluated, the error message is written instead. In case this happens with the If-expression in &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;WriteFileIf&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''', &lt;/ins&gt;the result is assumed to be true.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;div {{BoxWidthIndent|58|0}} &amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; # will result in &amp;quot;I don't know what &amp;quot;this&amp;quot; means&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; # will result in &amp;quot;I don't know what &amp;quot;this&amp;quot; means&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; WriteFile(filename, &amp;quot;this is nonsense&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; WriteFile(filename, &amp;quot;this is nonsense&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;There are easier ways to write numbers in a file, BUT with this example you can see how to use the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;&lt;/del&gt;runtime function&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot; &lt;/del&gt;AverageLuma:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;There are easier ways to write numbers in a file, BUT with this example you can see how to use the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''&lt;/ins&gt;runtime function&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'' [[&lt;/ins&gt;AverageLuma&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;]]&lt;/ins&gt;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;div {{BoxWidthIndent|58|0}} &amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; # create a test video to get different frames&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; # create a test video to get different frames&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; Version.FadeIn(50).ConvertToYV12()&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; Version.FadeIn(50).ConvertToYV12()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 56:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 66:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; colon = &amp;quot;: &amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; colon = &amp;quot;: &amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; WriteFile(&amp;quot;F:\text.log&amp;quot;, &amp;quot;current_frame&amp;quot;, &amp;quot;colon&amp;quot;, &amp;quot;AverageLuma&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; WriteFile(&amp;quot;F:\text.log&amp;quot;, &amp;quot;current_frame&amp;quot;, &amp;quot;colon&amp;quot;, &amp;quot;AverageLuma&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Or maybe you want the actual time printed, too:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Or maybe you want the actual time printed, too:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;div {{BoxWidthIndent|58|0}} &amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; # create a test video to get different frames&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; # create a test video to get different frames&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; Version.FadeIn(50).ConvertToYV12()&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; Version.FadeIn(50).ConvertToYV12()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 65:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 76:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; # the triple quotes are necessary to put quotes inside a string&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; # the triple quotes are necessary to put quotes inside a string&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; WriteFile(last, filename, &amp;quot;current_frame&amp;quot;, &amp;quot;&amp;quot;&amp;quot; time(&amp;quot; %H:%M:%S&amp;quot;) &amp;quot;&amp;quot;&amp;quot;, &amp;quot;AverageLuma&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; WriteFile(last, filename, &amp;quot;current_frame&amp;quot;, &amp;quot;&amp;quot;&amp;quot; time(&amp;quot; %H:%M:%S&amp;quot;) &amp;quot;&amp;quot;&amp;quot;, &amp;quot;AverageLuma&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''More examples:'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''More examples:'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;In WriteFileIf the FIRST expression is expected to be boolean (true or false).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;In &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;WriteFileIf&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''' &lt;/ins&gt;the FIRST expression is expected to be boolean (true or false).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Only if it is TRUE the other expressions are evaluated and the line is printed.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Only if it is TRUE the other expressions are evaluated and the line is printed.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;(Remember: &amp;amp;&amp;amp; is AND, || is OR, == is EQUAL, != is NOT EQUAL)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;(Remember: &amp;amp;&amp;amp; is AND, || is OR, == is EQUAL, != is NOT EQUAL)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;That way you can omit lines completely from your file.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;That way you can omit lines completely from your file.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;div {{BoxWidthIndent|58|0}} &amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; # create a test video to get different frames&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; # create a test video to get different frames&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; Version.FadeIn(50).ConvertToYV12()&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; Version.FadeIn(50).ConvertToYV12()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; # this will print the frame number, but only of frames where AverageLuma is between 30 and 60&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; # this will print the frame number, &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; WriteFileIf(last, filename, &amp;quot;(AverageLuma&amp;gt;30) &amp;amp;&amp;amp; (AverageLuma&amp;lt;60)&amp;quot;, &amp;quot;current_frame&amp;quot;, &amp;quot;&amp;quot;&amp;quot; &amp;quot;:&amp;quot; &amp;quot;&amp;quot;&amp;quot;, &amp;quot;AverageLuma&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; # &lt;/ins&gt;but only of frames where AverageLuma is between 30 and 60&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; WriteFileIf(last, filename, &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; \ &lt;/ins&gt;&amp;quot;(AverageLuma&amp;gt;30) &amp;amp;&amp;amp; (AverageLuma&amp;lt;60)&amp;quot;, &amp;quot;current_frame&amp;quot;, &amp;quot;&amp;quot;&amp;quot; &amp;quot;:&amp;quot; &amp;quot;&amp;quot;&amp;quot;, &amp;quot;AverageLuma&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/div&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''Changes:'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''Changes:'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 88:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 103:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;| Initial release.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;| Initial release.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/div&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[Category:Internal filters]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[Category:Internal filters]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[Category:Meta_filters]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[Category:Meta_filters]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[Category:Runtime_filters]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[Category:Runtime_filters]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Raffriff42</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php?title=WriteFile&amp;diff=6948&amp;oldid=prev</id>
		<title>Raffriff42: added category</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php?title=WriteFile&amp;diff=6948&amp;oldid=prev"/>
				<updated>2015-11-08T15:47:16Z</updated>
		
		<summary type="html">&lt;p&gt;added category&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 15:47, 8 November 2015&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 91:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 91:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[Category:Internal filters]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[Category:Internal filters]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Meta_filters]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Runtime_filters]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Raffriff42</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php?title=WriteFile&amp;diff=6009&amp;oldid=prev</id>
		<title>Raffriff42: formatting (bold, bullets); clarify 'append', 'flush'</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php?title=WriteFile&amp;diff=6009&amp;oldid=prev"/>
				<updated>2015-09-11T04:27:37Z</updated>
		
		<summary type="html">&lt;p&gt;formatting (bold, bullets); clarify &amp;#039;append&amp;#039;, &amp;#039;flush&amp;#039;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 04:27, 11 September 2015&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&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 class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{Template:Func4Def|WriteFile(clip ''clip'', string ''filename'', string ''expression1'' [, string ''expression2'' [, ...]] [, bool ''append'', bool ''flush''])|WriteFileIf(clip ''clip'', string ''filename'', string ''expression1'' [, string ''expression2'' [, ...]] [, bool ''append'', bool ''flush''])|WriteFileStart(clip ''clip'', string ''filename'', string ''expression1'' [, string ''expression2'' [, ...]] [, bool ''append''])|WriteFileEnd(clip ''clip'', string ''filename'', string ''expression1'' [, string ''expression2'' [, ...]] [, bool ''append''])}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{Template:Func4Def|WriteFile(clip ''clip'', string ''filename'', string ''expression1'' [, string ''expression2'' [, ...]] [, bool ''append'', bool ''flush''])|WriteFileIf(clip ''clip'', string ''filename'', string ''expression1'' [, string ''expression2'' [, ...]] [, bool ''append'', bool ''flush''])|WriteFileStart(clip ''clip'', string ''filename'', string ''expression1'' [, string ''expression2'' [, ...]] [, bool ''append''])|WriteFileEnd(clip ''clip'', string ''filename'', string ''expression1'' [, string ''expression2'' [, ...]] [, bool ''append''])}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;WriteFile &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;evaluates &lt;/del&gt;each ''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;expressionN&lt;/del&gt;'', &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;converts &lt;/del&gt;the result to a string and &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;puts &lt;/del&gt;the concatenated results into a file, followed by a newline.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;WriteFile&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''' and related functions evaluate &lt;/ins&gt;each &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[[Grammar|&lt;/ins&gt;''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;expression&lt;/ins&gt;''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;]]&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;convert &lt;/ins&gt;the result to a string and &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;put &lt;/ins&gt;the concatenated results into a file, followed by a newline. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The &amp;quot;run-time&amp;quot; variable current_frame is set so that you can use it in an &lt;/del&gt;''expression'' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;(this works &lt;/del&gt;similar &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;as &lt;/del&gt;with [[ScriptClip]], &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;look there in the docs for more info)&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;current_frame &lt;/del&gt;is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;set to -1 when &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;script &lt;/del&gt;is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;loaded and to -2 when &lt;/del&gt;the script &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;is closed&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;*'''WriteFile''' evaluates the &lt;/ins&gt;''expression''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;s and generates output for each frame rendered by the filter.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;*'''WriteFileIf''' is &lt;/ins&gt;similar&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;, but generates output only if the first expression is ''true''. &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;:* In both cases, there is no output at script opening or closure. &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;:* Note that &lt;/ins&gt;with [[ScriptClip]], &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;script opening and closure occurs on every frame&lt;/ins&gt;. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;:* Note that since output &lt;/ins&gt;is &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;produced only for ''rendered'' frames, there will be no output at all if &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;result of the filter &lt;/ins&gt;is &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;not [[The_script_execution_model|used]] in deriving the final result of &lt;/ins&gt;the script.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;WriteFile evaluates the &lt;/del&gt;''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;expression&lt;/del&gt;''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;s &lt;/del&gt;and &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;generates output for each frame rendered by the filter. WriteFileIf is similar, but generates &lt;/del&gt;output only &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;if the first expression is true. In both cases, there is no output at &lt;/del&gt;script opening &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;or &lt;/del&gt;closure. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Note that since output &lt;/del&gt;is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;produced only for &lt;/del&gt;''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;rendered&lt;/del&gt;'' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;frames&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;there will be no output &lt;/del&gt;at &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;all if &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;result &lt;/del&gt;of the filter &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;is not used &lt;/del&gt;in &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;deriving the final result of &lt;/del&gt;the script.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;*&lt;/ins&gt;''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'WriteFileStart'&lt;/ins&gt;'' and &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''WriteFileEnd''' generate &lt;/ins&gt;output only &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;on &lt;/ins&gt;script opening &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;and &lt;/ins&gt;closure &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;respectively&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;:* There &lt;/ins&gt;is &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;no action on each frame, unless used within [[ScriptClip]]. &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;:* The &lt;/ins&gt;''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;expression&lt;/ins&gt;''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;s are evaluated exactly once&lt;/ins&gt;, at the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;location &lt;/ins&gt;of the filter in the script.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;WriteFileStart &lt;/del&gt;and &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;WriteFileEnd generate output only on &lt;/del&gt;script opening and closure &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;respectively, there is no action on each &lt;/del&gt;frame. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;In both cases&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;the &lt;/del&gt;''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;expression&lt;/del&gt;''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;s are evaluated exactly once&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;at the location of the filter in the script&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;*When ''append = true'', the results will be appended to any existing file ''filename''; if ''false'', a new file is created &lt;/ins&gt;and &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;the old one is overwritten. &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;:* Only &lt;/ins&gt;script opening and closure &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;are affected; '''WriteFile''' and '''WriteFileIf''' per-&lt;/ins&gt;frame &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;execution ''always'' append&lt;/ins&gt;. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;:* The default for ''append'' is ''true''&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;except for &lt;/ins&gt;''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'WriteFileStart'&lt;/ins&gt;'', &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;where it is ''false''&lt;/ins&gt;. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;When ''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;append &lt;/del&gt;= true'', &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;the result(s) will be appended to &lt;/del&gt;any &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;existing &lt;/del&gt;file. The default for ''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;append&lt;/del&gt;'' is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;always &lt;/del&gt;''true''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;, except &lt;/del&gt;for &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;WriteFileStart (here it is &lt;/del&gt;''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;false&lt;/del&gt;'').&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;*&lt;/ins&gt;When ''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;flush &lt;/ins&gt;= true'', &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;after each operation a 'flush' is performed: &lt;/ins&gt;any &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;unwritten data is written to disk, and the &lt;/ins&gt;file &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;is closed and reopened&lt;/ins&gt;. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;:* After flushing you may read the updated file immediately, either through [[ConditionalReader]] or an external application. &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;:* &lt;/ins&gt;The default for ''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;flush&lt;/ins&gt;'' is ''true'' for '''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;WriteFile&lt;/ins&gt;'&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'' and '''WriteFileIf''' and ''always'' true (no user option&lt;/ins&gt;) &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;for '''WriteFileStart''' and '''WriteFileEnd'''. &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;:* Note that flushing after every frame may be significantly slower&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;When &lt;/del&gt;''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;flush = true&lt;/del&gt;''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;, the file &lt;/del&gt;is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;closed and reopened after each operation &lt;/del&gt;so you can &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;see the result immediately &lt;/del&gt;(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;this may be slower&lt;/del&gt;). &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The default for &lt;/del&gt;''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;flush&lt;/del&gt;'' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;(WriteFile and WriteFileIf) &lt;/del&gt;is ''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;true&lt;/del&gt;''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;. For WriteFileStart &lt;/del&gt;and &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;WriteFileEnd, &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;file &lt;/del&gt;is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;always &lt;/del&gt;closed &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;immediately after writing&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;*The [[Runtime_environment#Special_runtime_variables_and_functions|run-time variable]] &lt;/ins&gt;''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;current_frame&lt;/ins&gt;'' is &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;set &lt;/ins&gt;so &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;that &lt;/ins&gt;you can &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;use it in ''expression''s &lt;/ins&gt;(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;as with [[ScriptClip#ScriptClip|ScriptClip]]&lt;/ins&gt;).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;:* &lt;/ins&gt;''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;current_frame&lt;/ins&gt;'' is &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;set to &lt;/ins&gt;''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;-1&lt;/ins&gt;'' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;when the script is loaded &lt;/ins&gt;and &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;to ''-2'' when &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;script &lt;/ins&gt;is closed.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;hr&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Usage is best explained with some simple examples:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Usage is best explained with some simple examples:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 20:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 34:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; # the expression here is only a variable, which is evaluated and put in the file&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; # the expression here is only a variable, which is evaluated and put in the file&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; # you will get a file with the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;framenumber &lt;/del&gt;in each line&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; # you will get a file with the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;frame number &lt;/ins&gt;in each line&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; WriteFile(filename, &amp;quot;current_frame&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; WriteFile(filename, &amp;quot;current_frame&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Raffriff42</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php?title=WriteFile&amp;diff=595&amp;oldid=prev</id>
		<title>Admin: 1 revision</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php?title=WriteFile&amp;diff=595&amp;oldid=prev"/>
				<updated>2013-05-09T15:02:26Z</updated>
		
		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='1' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='1' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 15:02, 9 May 2013&lt;/td&gt;
			&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php?title=WriteFile&amp;diff=594&amp;oldid=prev</id>
		<title>Wilbert: nearly unlimited number of expressions</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php?title=WriteFile&amp;diff=594&amp;oldid=prev"/>
				<updated>2010-01-05T19:05:34Z</updated>
		
		<summary type="html">&lt;p&gt;nearly unlimited number of expressions&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Template:Func4Def|WriteFile(clip ''clip'', string ''filename'', string ''expression1'' [, string ''expression2'' [, ...]] [, bool ''append'', bool ''flush''])|WriteFileIf(clip ''clip'', string ''filename'', string ''expression1'' [, string ''expression2'' [, ...]] [, bool ''append'', bool ''flush''])|WriteFileStart(clip ''clip'', string ''filename'', string ''expression1'' [, string ''expression2'' [, ...]] [, bool ''append''])|WriteFileEnd(clip ''clip'', string ''filename'', string ''expression1'' [, string ''expression2'' [, ...]] [, bool ''append''])}}&lt;br /&gt;
&lt;br /&gt;
WriteFile evaluates each ''expressionN'', converts the result to a string and puts the concatenated results into a file, followed by a newline.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;run-time&amp;quot; variable current_frame is set so that you can use it in an ''expression'' (this works similar as with [[ScriptClip]], look there in the docs for more info). current_frame is set to -1 when the script is loaded and to -2 when the script is closed.&lt;br /&gt;
&lt;br /&gt;
WriteFile evaluates the ''expression''s and generates output for each frame rendered by the filter. WriteFileIf is similar, but generates output only if the first expression is true. In both cases, there is no output at script opening or closure. Note that since output is produced only for ''rendered'' frames, there will be no output at all if the result of the filter is not used in deriving the final result of the script.&lt;br /&gt;
&lt;br /&gt;
WriteFileStart and WriteFileEnd generate output only on script opening and closure respectively, there is no action on each frame. In both cases, the ''expression''s are evaluated exactly once, at the location of the filter in the script.&lt;br /&gt;
&lt;br /&gt;
When ''append = true'', the result(s) will be appended to any existing file. The default for ''append'' is always ''true'', except for WriteFileStart (here it is ''false'').&lt;br /&gt;
&lt;br /&gt;
When ''flush = true'', the file is closed and reopened after each operation so you can see the result immediately (this may be slower). The default for ''flush'' (WriteFile and WriteFileIf) is ''true''. For WriteFileStart and WriteFileEnd, the file is always closed immediately after writing.&lt;br /&gt;
 &lt;br /&gt;
Usage is best explained with some simple examples:&lt;br /&gt;
&lt;br /&gt;
 filename = &amp;quot;c:\myprojects\output.txt&amp;quot;&lt;br /&gt;
 # create a test video to get frames&lt;br /&gt;
 Version()&lt;br /&gt;
 &lt;br /&gt;
 # the expression here is only a variable, which is evaluated and put in the file&lt;br /&gt;
 # you will get a file with the framenumber in each line&lt;br /&gt;
 WriteFile(filename, &amp;quot;current_frame&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 # this line is written when the script is opened&lt;br /&gt;
 WriteFileStart(filename, &amp;quot;&amp;quot;&amp;quot; &amp;quot;This is the header&amp;quot; &amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 # and this when the script is closed&lt;br /&gt;
 WriteFileEnd(filename, &amp;quot;&amp;quot;&amp;quot; &amp;quot;Now the script was closed&amp;quot; &amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Look how you can use triple-quotes to type a string in a string! If the expression cannot be evaluated, the error message is written instead. In case this happens with the If-expression in WriteFileIf the result is assumed to be true.&lt;br /&gt;
&lt;br /&gt;
 # will result in &amp;quot;I don't know what &amp;quot;this&amp;quot; means&amp;quot;&lt;br /&gt;
 WriteFile(filename, &amp;quot;this is nonsense&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
There are easier ways to write numbers in a file, BUT with this example you can see how to use the &amp;quot;runtime function&amp;quot; AverageLuma:&lt;br /&gt;
&lt;br /&gt;
 # create a test video to get different frames&lt;br /&gt;
 Version.FadeIn(50).ConvertToYV12()&lt;br /&gt;
 &lt;br /&gt;
 # this will print the frame number, a &amp;quot;:&amp;quot; and the average luma for that frame&lt;br /&gt;
 colon = &amp;quot;: &amp;quot;&lt;br /&gt;
 WriteFile(&amp;quot;F:\text.log&amp;quot;, &amp;quot;current_frame&amp;quot;, &amp;quot;colon&amp;quot;, &amp;quot;AverageLuma&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Or maybe you want the actual time printed, too:&lt;br /&gt;
&lt;br /&gt;
 # create a test video to get different frames&lt;br /&gt;
 Version.FadeIn(50).ConvertToYV12()&lt;br /&gt;
 &lt;br /&gt;
 # this will print the frame number, the current time and the average luma for that frame&lt;br /&gt;
 # the triple quotes are necessary to put quotes inside a string&lt;br /&gt;
 WriteFile(last, filename, &amp;quot;current_frame&amp;quot;, &amp;quot;&amp;quot;&amp;quot; time(&amp;quot; %H:%M:%S&amp;quot;) &amp;quot;&amp;quot;&amp;quot;, &amp;quot;AverageLuma&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
'''More examples:'''&lt;br /&gt;
&lt;br /&gt;
In WriteFileIf the FIRST expression is expected to be boolean (true or false).&lt;br /&gt;
Only if it is TRUE the other expressions are evaluated and the line is printed.&lt;br /&gt;
(Remember: &amp;amp;&amp;amp; is AND, || is OR, == is EQUAL, != is NOT EQUAL)&lt;br /&gt;
That way you can omit lines completely from your file.&lt;br /&gt;
&lt;br /&gt;
 # create a test video to get different frames&lt;br /&gt;
 Version.FadeIn(50).ConvertToYV12()&lt;br /&gt;
 &lt;br /&gt;
 # this will print the frame number, but only of frames where AverageLuma is between 30 and 60&lt;br /&gt;
 WriteFileIf(last, filename, &amp;quot;(AverageLuma&amp;gt;30) &amp;amp;&amp;amp; (AverageLuma&amp;lt;60)&amp;quot;, &amp;quot;current_frame&amp;quot;, &amp;quot;&amp;quot;&amp;quot; &amp;quot;:&amp;quot; &amp;quot;&amp;quot;&amp;quot;, &amp;quot;AverageLuma&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
'''Changes:'''&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| v2.60&lt;br /&gt;
| Number of expressions changed from 16 to nearly unlimited.&lt;br /&gt;
|-&lt;br /&gt;
| v2.55&lt;br /&gt;
| Initial release.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Internal filters]]&lt;/div&gt;</summary>
		<author><name>Wilbert</name></author>	</entry>

	</feed>