<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://miniscript.org/w/index.php?action=history&amp;feed=atom&amp;title=File.exists</id>
	<title>File.exists - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://miniscript.org/w/index.php?action=history&amp;feed=atom&amp;title=File.exists"/>
	<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=File.exists&amp;action=history"/>
	<updated>2026-04-10T15:05:33Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.0</generator>
	<entry>
		<id>http://miniscript.org/w/index.php?title=File.exists&amp;diff=662&amp;oldid=prev</id>
		<title>Mantic: Initial file.exists page.</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=File.exists&amp;diff=662&amp;oldid=prev"/>
		<updated>2021-01-24T03:39:53Z</updated>

		<summary type="html">&lt;p&gt;Initial file.exists page.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;In [[Mini Micro]] and [[command-line MiniScript]], the &amp;lt;c&amp;gt;[[file]].exists&amp;lt;/c&amp;gt; function checks if a file or directory exists at the specified path. &lt;br /&gt;
&lt;br /&gt;
=== Arguments ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter Name !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| filePath|| an absolute or relative path of the file or directory to be tested.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 1  ''(true)'' || The file or directory exists. &lt;br /&gt;
|-&lt;br /&gt;
| 0 ''(false)'' || The file or directory does not exist.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
Test the existence of various files and directories: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;if file.exists(&amp;quot;/usr2&amp;quot;) then print &amp;quot;/usr2 appears to be mounted!&amp;quot;&lt;br /&gt;
if file.exists(&amp;quot;/usr2/myapp.ms&amp;quot;) then print &amp;quot;myapp.ms is there!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
// Look for a file in the parent directory of the current working directory. &lt;br /&gt;
if not file.exists(&amp;quot;../output.txt&amp;quot;) then&lt;br /&gt;
  file.writeLines &amp;quot;../output.txt&amp;quot;, &amp;quot;This file will be created with this string at the top. Woot!&amp;quot;&lt;br /&gt;
else&lt;br /&gt;
  file.writeLines &amp;quot;../output.txt&amp;quot;, &amp;quot;This file will be overwritten with a BETTER string at the top.&amp;quot;&lt;br /&gt;
end if&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Mini Micro]]&lt;br /&gt;
[[Category:Command-Line MiniScript]]&lt;/div&gt;</summary>
		<author><name>Mantic</name></author>
		
	</entry>
</feed>