1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
<html>
<head>
<title>EAGLE Help: fileerror()</title>
</head>
<body bgcolor=white>
<font face=Helvetica,Arial>
<hr>
<i>EAGLE Help</i>
<h1><center>fileerror()</center></h1>
<hr>
<dl>
<dt>
<b>Function</b>
<dd>
Returns the status of I/O operations.
<p>
<dt>
<b>Syntax</b>
<dd>
<tt>int fileerror();</tt>
<p>
<dt>
<b>Returns</b>
<dd>
The <tt>fileerror</tt> function returns <tt>0</tt> if everything is ok.
<p>
<dt>
<b>Description</b>
<dd>
<tt>fileerror</tt> checks the status of any I/O operations that have been performed
since the last call to this function and returns <tt>0</tt> if everything was ok.
If any of the I/O operations has caused an error, a value other than <tt>0</tt>
will be returned.
<p>
You should call <tt>fileerror</tt> before any I/O operations to reset any previous
error state, and call it again after the I/O operations to see if they were successful.
<p>
When <tt>fileerror</tt> returns a value other than <tt>0</tt> (thus indicating an error)
a proper error message has already been given to the user.
</dl>
<b>See also</b> <a href=277.htm>output</a>,
<a href=255.htm>printf</a>,
<a href=240.htm>fileread</a>
<p>
<b>Example</b>
<pre>
fileerror();
output("file.txt", "wt") {
printf("Test\n");
}
if (fileerror())
exit(1);
</pre>
<hr>
<table width=100% cellspacing=0 border=0><tr><td align=left><font face=Helvetica,Arial>
<a href=index.htm>Index</a>
</font></td><td align=right><font face=Helvetica,Arial size=-1>
<i>Copyright © 2005 CadSoft Computer GmbH</i>
</font></td></tr></table>
<hr>
</font>
</body>
</html>
|