file_bin_close

Closes a previously opened binary file. You supply the file ID value, as returned by the function file_bin_open().

The function will return true if the operation was a success, however if there was a failure in closing the file or when the file was first opened, this will return false.

NOTE These functions do not work when the target module is HTML5.

 

Syntax:

file_bin_close(binfile);

ArgumentTypeDescription
binfileBinary File IDThe ID of the file to close.

 

Returns:

Boolean

 

Example:

file = file_bin_open("myfile.bin", 2);
file_bin_rewrite(file);
file_bin_close(file);

This would open a file from the same directory as the game, and assign its index to the variable "file". It would then re-write the file (clearing it of data), and close it again.