- This wiki is out of date, use the continuation of this wiki instead
Fclose
From FenixWiki
(Difference between revisions)
| Revision as of 23:41, 12 June 2007 (edit) Woody (Talk | contribs) ← Previous diff |
Current revision (14:01, 26 June 2007) (edit) (undo) Sandman (Talk | contribs) m |
||
| Line 5: | Line 5: | ||
| '''INT''' fclose ( <'''INT''' filehandle> ) | '''INT''' fclose ( <'''INT''' filehandle> ) | ||
| - | Unloads a file previously loaded with [[fopen]]. | + | Unloads a file previously loaded with [[fopen]](). |
| == Parameters == | == Parameters == | ||
| {| | {| | ||
| - | | '''INT''' filehandle || - The | + | | '''INT''' filehandle || - The [[FileHandle]] of the file returned by [[fopen]](). |
| |} | |} | ||
| == Returns == | == Returns == | ||
| - | + | '''INT''': [[true]] | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| == Example == | == Example == | ||
| Line 30: | Line 26: | ||
| fread(handle,druppels); // reads from the file and puts the data in druppels | fread(handle,druppels); // reads from the file and puts the data in druppels | ||
| fclose(handle); // zipping up after business is done | fclose(handle); // zipping up after business is done | ||
| - | + | write(0,0,0,0,druppels); // shows the value of druppels | |
| End | End | ||
| </pre> | </pre> | ||
| - | Used in example: [[fopen]](), [[fread]](), [[ | + | Used in example: [[fopen]](), [[fread]](), [[write]]() |
Current revision
Contents |
[edit] Definition
INT fclose ( <INT filehandle> )
Unloads a file previously loaded with fopen().
[edit] Parameters
| INT filehandle | - The FileHandle of the file returned by fopen(). |
[edit] Returns
INT: true
[edit] Example
Process loadthing(STRING loadpath);
Private
int handle; // handle for the loaded file
int druppels; // here's where the loaded data go
Begin
handle=fopen(loadpath,O_READ); // opens the file in reading mode
fread(handle,druppels); // reads from the file and puts the data in druppels
fclose(handle); // zipping up after business is done
write(0,0,0,0,druppels); // shows the value of druppels
End
