This function saves the contents of a buffer to a file, ready to be read back into memory using the buffer_load function.
NOTE On HTML5 the contents of the buffer will be saved as base64 encoded strings when using this function.
buffer_save(buffer, filename);
Argument | Type | Description |
---|---|---|
buffer | Buffer | The buffer to save. |
filename | String | The name of the file to save as. |
N/A
buffer_save(buff, "Player_Save.sav");
The above code saves the current contents of the buffer stored in the variable buff to a file.