Lua:createFileStream

From Cheat Engine
Revision as of 19:26, 23 June 2026 by Leunsel (talk | contribs) (Initial page creation.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<> Reference

function createFileStream(filename, mode) : FileStream

Creates a stream backed by a file.

Use fmCreate, fmOpenRead, fmOpenWrite, or fmOpenReadWrite as the base mode. Sharing flags can be combined with the mode.

Function Parameters[edit]

Parameter Type Description
filename String Path of the file to create or open.
mode Integer File mode constant, optionally combined with a sharing flag.

Returns[edit]

FileStream — The opened file stream.

Examples[edit]

local stream = createFileStream("C:\\Temp\\output.bin", fmCreate)
stream.writeByte(0x42)
stream.destroy()

See Also[edit]

Main Pages