- Documentation
- Shared functions
- fileFlush
Function
fileFlush
Writes buffered file data to disk without closing it. Useful for logs that must survive a crash.
Syntax
bool fileFlush(file theFile)Arguments
theFilefile- A file handle.
Returns
true on success.
Example
local log = fileCreate("events.log")
addEventHandler("onPlayerJoin", root, function()
fileWrite(log, getPlayerName(source) .. " wszedl\n")
fileFlush(log)
end)