ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. fileFlush

Function

fileFlush

Server and clientFilesIdentical to MTA:SA

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)

See also