ReadFile

This function opens a file with read access.

Syntax

Parameters

Returns

If the file is able to be opened, a new stream is returned, otherwise NULL is returned.

Example

local path = "MyFile.txt" 
local stream = FileSystem:OpenFile(path)

if (stream) then

stream:WriteLine("Hello!")
stream:Release()
end

stream = FileSystem:ReadFile(path)
if (stream) then

System:Print(stream:ReadLine())
stream:Release()
end