string ReadFileText(string, int, string, bool)

Reads characters from a file

Security

Trust Level Required: Full Trust

Parameters

Name Description
filePath string
The path of the file.
maxCharsToRead (Optional) int
The maximum number of characters to read or -1 to read until the end of the file. Defaults to -1.
characterEncoding (Optional) string
Standard character encoding name to use when interpreting bytes to characters. The Default is null which passes the default encoding for the .Net implementation.
useByteOrderMarks (Optional) bool
True to use byte order marks. Defaults to true.

Return

The file text.

Remarks

The kiosk user must have sufficient permissions to perform any file IO operation that performs a read or write operation on the current disk.

Examples


var sampleFile = KioApp.DoUrlSubstitution('$$KIO_USERDATA$$') + 'sampleFile.txt';
var sampleFileInfo = KioFileIO.GetFileDetails(sampleFile);
console.log(KioFileIO.ReadFileText(sampleFile, (JSON.parse(sampleFileInfo).Length)));
    

Requirements

KioWare for Windows version 8.2 or greater.