Difference between revisions of "(File):setBuffer"

(Created page)
 
m (Added note about File:flush)
 
Line 1: Line 1:
 
{{newin|[[0.9.0]]|090|type=function}}
 
{{newin|[[0.9.0]]|090|type=function}}
 
Sets the buffer mode for a file opened for writing or appending. Files with buffering enabled will not write data to the disk until the buffer size limit is reached, depending on the buffer mode.
 
Sets the buffer mode for a file opened for writing or appending. Files with buffering enabled will not write data to the disk until the buffer size limit is reached, depending on the buffer mode.
 +
 +
[[(File):flush|File:flush]] will force any buffered data to be written to the disk.
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===

Latest revision as of 20:14, 2 September 2013

Available since LÖVE 0.9.0
This function is not supported in earlier versions.

Sets the buffer mode for a file opened for writing or appending. Files with buffering enabled will not write data to the disk until the buffer size limit is reached, depending on the buffer mode.

File:flush will force any buffered data to be written to the disk.

Function

Synopsis

success, errorstr = File:setBuffer( mode, size )

Arguments

BufferMode mode
The buffer mode to use.
number size (0)
The maximum size in bytes of the file's buffer.

Returns

boolean success
Whether the buffer mode was successfully set.
string errorstr (nil)
The error string, if the buffer mode could not be set and an error occurred.

See Also

Other Languages