Content deleted Content added
m sp |
{{wrongtitle}}, cat. |
||
Line 1:
{{wrongtitle|title="fopen"}}
In [[computer programming]], the <code>'''fopen'''</code>, with related functions <code>'''fdopen'''</code> and '''<code>freopen</code>''', is one of the basic functions in the [[C programming language]]. They return a [[stream]] attached to the specified [[computer file|file]] from which reading and writing can be done. Because it is so popular, many script languages derived from C tend to provide the same function with the same or similar functionality. It is considered higher-level than the <code>[[open]]</code> [[system call]] of UNIX operating systems.
Line 27 ⟶ 29:
A convenient way to find the length of a file in C is:
<pre><nowiki>
FILE *f = fopen("filename", "rb");
fseek(f, 0, SEEK_END);
length = tell(f);
rewind(f);
</nowiki></pre>
[[Category:C standard library]]
|