<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://script.quakenet.org/wiki/index.php?action=history&amp;feed=atom&amp;title=%24fopen</id>
	<title>$fopen - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://script.quakenet.org/wiki/index.php?action=history&amp;feed=atom&amp;title=%24fopen"/>
	<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=$fopen&amp;action=history"/>
	<updated>2026-06-04T03:25:54Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=$fopen&amp;diff=4465&amp;oldid=prev</id>
		<title>Doomie at 07:40, 19 December 2005</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=$fopen&amp;diff=4465&amp;oldid=prev"/>
		<updated>2005-12-19T07:40:17Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Returns information about an open file.&lt;br /&gt;
 $fopen(name | N)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$fopen has the following properties:&lt;br /&gt;
{| style=&amp;quot;width:100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width:10%&amp;quot; | &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Property&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; || Style=&amp;quot;width:90%&amp;quot; | &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Meaning&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| fname      || returns the full path and file name assigned to the specified name / number.&lt;br /&gt;
|-&lt;br /&gt;
| pos      || returns the position of the pointer (after what byte it is).&lt;br /&gt;
|-&lt;br /&gt;
| eof      || returns 1 if end of file is reached, else 0.&lt;br /&gt;
|-&lt;br /&gt;
| err      || returns 1 if an error occurred, else 0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note&amp;#039;&amp;#039;&amp;#039; that the .eof and .err properties should be checked after each file access command or identifier, since file access errors will not halt a script.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
We have the following file called moo.txt in our mircdir:&lt;br /&gt;
 one&lt;br /&gt;
 two&lt;br /&gt;
 three&lt;br /&gt;
At first, we open it using &amp;#039;&amp;#039;[[fopen]] moo moo.txt&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 [[echo]] -a $fopen(moo).fname&lt;br /&gt;
This would return &amp;#039;&amp;#039;C:\program\mIRC\moo.txt&amp;#039;&amp;#039; if your mIRC is installed to C:\program, else the path to your mIRC installation (it is the same as &amp;#039;&amp;#039;[[$mircdir]] [[DollarPlus|$+]] moo.txt&amp;#039;&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 echo -a $fopen(moo).err&lt;br /&gt;
This example returns 0 as no error occurred.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ; echo the current position of the pointer&lt;br /&gt;
 echo -a $fopen(moo).pos&lt;br /&gt;
 ; this would echo 0, as it is at the begin of the file&lt;br /&gt;
 ; now let&amp;#039;s read a line to move the pointer&lt;br /&gt;
 echo -a [[$fread]](moo)&lt;br /&gt;
 ; echo the new position of the pointer&lt;br /&gt;
 echo -a $fopen(moo).pos&lt;br /&gt;
 ; as the pointer was moved, it will now return 5 (it was moved 5 bytes)&lt;br /&gt;
 ; the first three bytes are obvious (o, n, e), then there is a [[$cr]], at the end of the line a [[$lf]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:File Handling]]&lt;/div&gt;</summary>
		<author><name>Doomie</name></author>
	</entry>
</feed>