OpenFile
This function opens a file with read and write access.
Syntax
- Stream OpenFile(string path)
Parameters
- path: the path to the file to open.
Returns
If the file is able to be opened, a new stream is returned, otherwise NULL is returned.
Remarks
This function will return NULL if Lua sandboxing is enabled.
Example
local path = "MyFile.txt"
local stream = FileSystem:OpenFile(path)
if (stream) then
stream:WriteLine("Hello!")
stream:Seek(0)
System:Print(stream:ReadLine())
stream:Release()
end