User Tools

Site Tools


Sidebar

file:function_readfile

readFile()

Function to read the contents of a file. The function returns the content of the file. Line feeds are preserved. This function is the equivalent of the method .readFile().

Usage

var file = new File("C:/myfile.txt");
var filecontents = readFile(file);

Parameters

Parameter Data type Required Description
file file object True The file to read the content from
encoding string The file encoding used for reading the file. Default encoding is UTF-8

Return Values

Value Meaning
null The file does not exist
string The contents of the file
file/function_readfile.txt · Last modified: 2017/05/25 10:31 (external edit)