Fwrite

From Bennu Wiki
Jump to: navigation, search


Definition

INT fwrite ( <INT filehandle> , <VARIABLE data> )

INT fwrite ( <VOID POINTER data_pos> , <INT length> , <INT filehandle>)

Writes the variable data to a file loaded with fopen.

to be extended...

Parameters

INT filehandle - Identifier of the file loaded with fopen.
VARIABLE data - The data to write to the file (any type of variable).

Returns

INT : The number of bytes written to the file.

Example

Process writething(STRING loadpath);
Private
    handle;   // handle for the loaded file 
    druppels; // the data to write to the file

Begin

    druppels=rand(1,10);

    handle=fopen(loadpath,O_WRITE); // opens the file in writing mode
    fwrite(handle,druppels);        // writes the druppels variable to the file
    fclose(handle);                 // zipping up after business is done

End

Used in example: fopen(), fclose(), rand()


Mod_file
Constants ORDWROREADOREADWRITEOWRITEOZREADOZWRITESEEKCURSEEKENDSEEKSET
Functions Fclose()Feof()Fexists()Fflush()Fgets()File()Flength()Fmove()Fopen()Fputs()Fread()Fremove()Frewind()Fseek()Ftell()Fwrite()Load()Save()