IO.read

Returns all the data from the specified file. Converts the data from the specified charset to unicode.

IO.read(fileName, charset);

Arguments

Name Description
fileName(string) The absolute path of the file.

charset (Optional)

(string) The charset of the file, if it is not UTF-8.

Supported charsets: ['binary', 'UTF-8', 'UTF-16', 'base64', 'ANSI']

Return value

A string upon success. Returns content of the specified file.

Example

Copy code
var log = IO.read(TC.scriptDir + "mylog.txt");
TC.log(log);