Skip to content
mikechambers edited this page May 31, 2012 · 5 revisions

Module Name : NativeFileSystem

Path : file/NativeFileSystem.js

The NativeFileSystem module provides an API for accessing and working with files and directories on the users system. It follows the w3c File System API Draft Specification. From the source comments, it appears that is was implemented using April 11, 2011 draft of the specification.

Usage

var NativeFileSystem = require("file/NativeFileSystem").NativeFileSystem;
var DirectoryEntry = NativeFileSystem.DirectoryEntry;

Things to Watch out for

Encodings

Currently, the only encoding supported is UTF-8 (utf-8), which can be accessed via the following constant:

NativeFileSystem.Encodings.UTF8

Security Errors

Currently, any errors that occur which do not map to standard FileError errors, will be mapped to FileError.SECURITY_ERR (as specified by the File API draft).

This includes:

  • ERR_UNKNOWN
  • ERR_INVALID_PARAMS
  • ERR_UNSUPPORTED_ENCODING

If you run into a FileError.SECURITY_ERR while working with the API, you should debug as if it is a security error, or one of the errors listed above.

Additional Resources

Clone this wiki locally