Flags

Supplies arguments to the [DirectoryEntry](../directoryentry/directoryentry.html) object's getFile() and getDirectory() methods, which look up or create files and directories, respectively.

Properties

  • create: Indicates that the file or directory should be created if it does not already exist. (boolean)

  • exclusive: Has has no effect by itself, but when used with create causes the file or directory creation to fail if the target path already exists. (boolean)

Supported Platforms

  • Amazon Fire OS
  • Android
  • BlackBerry WebWorks 5.0+
  • iOS
  • Windows Phone 7 and 8
  • Windows 8

Quick Example

// Get the data directory, creating it if it doesn't exist.
dataDir = fileSystem.root.getDirectory("data", {create: true});

// Create the lock file, if and only if it doesn't exist.
lockFile = dataDir.getFile("lockfile.txt", {create: true, exclusive: true});