This wiki is out of date, use the continuation of this wiki instead

Fclose

From FenixWiki

(Difference between revisions)
Jump to: navigation, search

Revision as of 23:41, 12 June 2007


Contents

Definition

INT fclose ( <INT filehandle> )

Unloads a file previously loaded with fopen.

Parameters

INT filehandle - The handle of the file returned by fopen.

Returns

0 - Could not unload?
1 - Successfully unloaded?

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

End

Used in example: fopen(), fread(), write_int()

Personal tools