Share this page

# 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);

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: