temp.readText method

Reads the specified file. If the file doesn't exist, the specified default value is returned.

Syntax

var promise = WinJS.Application.temp.readText(fileName, def);

Parameters

  • fileName
    Type: String

    The file to read from.

  • def
    Type: String

    The default value to be returned if the file failed to open.

Return value

Type: Promise

A promise that completes with a value that is either the contents of the file, or the specified default value.

Requirements

Minimum WinJS version

WinJS 1.0

Namespace

WinJS.Application

See also

temp