<doc>
	<legacy_id>1408</legacy_id>
	<name>close file</name>
	<type>command</type>

	<syntax>
		<example>close file <i>filePath</i></example>
	</syntax>

	<synonyms>
	</synonyms>

	<summary>Closes a <keyword tag="file">file</keyword> that was opened with the <command tag="open file">open file</command> <glossary tag="command">command</glossary>.</summary>

	<examples>
<example>close file "/Desktop/Temp"</example>
<example>close file line 1 of the openFiles</example>
<example><p>open file (specialFolderPath("desktop") &amp; "/text.txt")</p><p>write "This is a test" to file (specialFolderPath("desktop") &amp; "/text.txt")</p><p>close file (specialFolderPath("desktop") &amp; "/text.txt")</p></example>
	</examples>

	<history>
		<introduced version="1.0">Added.</introduced>
		<deprecated version=""></deprecated>
		<removed version=""></removed>
		
		<experimental version=""></experimental>
		<nonexperimental version=""></nonexperimental>
	</history>

	<objects>
	</objects>

	<platforms>
		<mac/>
		<windows/>
		<linux/>
		<ios/>
		<android/>
	</platforms>

	<classes>
		<desktop/>
		<server/>
		<web/>
		<mobile/>
	</classes>

	<security>
		<disk/>
	</security>


	<classification>
		<category>Files, Folders, &amp; Resources</category>
	</classification>

	<references>
		<function tag="openFiles">openFiles Function</function>
		<function tag="sysError">sysError Function</function>
		<command tag="delete file">delete file Command</command>
		<command tag="open file">open file Command</command>
		<command tag="read from file">read from file Command</command>
		<command tag="write to file">write to file Command</command>
		<command tag="seek">seek Command</command>
		<command tag="close">close Command</command>
		<command tag="close driver">close driver Command</command>
		<property tag="serialControlString">serialControlString Property</property>
		<keyword tag="COMn:">COMn: Keyword</keyword>
		<keyword tag="modem:">modem: Keyword</keyword>
		<keyword tag="file">file Keyword</keyword>
		<keyword tag="LPT1:">LPT1: Keyword</keyword>
		<keyword tag="printer:">printer: Keyword</keyword>
	</references>

	<description>Use the <b>close file</b> <glossary tag="command">command</glossary> to release a <keyword tag="file">file</keyword> after reading from it or writing to it. (A <keyword tag="file">file</keyword> that is open for writing can't be used by any other application until you've closed the <keyword tag="file">file</keyword>.)<p></p><p><b>Parameters:</b></p><p>The <i>filePath</i> is the <glossary tag="file path">name and location</glossary> of the <keyword tag="file">file</keyword> you want to close. If you specify a name but not a location, LiveCode assumes the <keyword tag="file">file</keyword> is in the <property tag="defaultFolder">defaultFolder</property>.</p><p></p><p><b>Comments:</b></p><p>Any files you have opened are closed automatically when you quit the application.</p><p></p><p>If you try to close a file that is not already open, the <b>result</b> function is set to.</p></description>
</doc>