standard.C.io.ReadFile

ReadFile is available since version 1.0.

Prototype:

string ReadFile(string path)

Parameters

path
[in] A string containing the path of existing file.

Description:

Reads the entire content of a file into a string. Warning: This function provides very small error control (it returns an empty string if the file couldn't be read, but it returns the same when reading a file that has 0 bytes in length).
This is the recommended function to use when working with small to medium files. (file sizes smaller than 50 megabytes. When using on large files, you'll have the entire file in the memory). For writing a file, you may want to check the WriteFile function.

Return value:

Returns the content of a file. If the file couldn't be read, the returned string is empty.