- Accelerometer
- Camera
- Capture
- Compass
- Connection
- Contacts
- Device
- Events
- File
- Geolocation
- Globalization
- InAppBrowser
- Media
- Notification
- Splashscreen
- Storage
- Overview
- Platform Guides
- The Cordova Command-line Interface
- Command-Line Usage
- Privacy Guide
- Upgrading Guides
- Project Settings
- Plugin Development Guide
- Domain Whitelist Guide
- Embedding WebView
This version of the documentation is outdated!
Click here for the latest released version.
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
- Android
- BlackBerry WebWorks (OS 5.0 and higher)
- 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});