top

openFile

Published 2014-10-28 | (Compatible with SDK 2.5,3.5,4.5,5.0,5.1 and 2010,2011,2012,2013,2014 models)

Opens files in an application.

The openFile class opens files in an application.

openFile
Syntax fileSystemObj.openFile(filePath, mode);
Parameter
filePath (String)
path including a file name.
mode (String)
  • r : Open a file for reading. The file must exist. Only r mode is available.
Return Value
(Browser file object)
Returns file object defined in browser. Character strings are read by calling readLine(), readAll() methods that file object has.
Remarks openCommonFile() enables files to input and output in common area of all applications, on the other hand, openFile() is only able to ‘read’ files in directory where an application is installed.
Example
var fileSystemObj = new FileSystem();
var fileObj = fileSystemObj.openFile('$WIDGET' + '/testFile.data', 'r'),
var data = fileObj.readAll();
Enumeration None