Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

DeviceStorageChangeEvent

This article needs a technical review. How you can help.

This API is available on Firefox OS for privileged or certified applications only.

Summary

The DeviceStorageChangeEvent provides information about any change made to a file inside a given storage area. It extends the Event interface.

The change event is triggered each time a file is created, modified, or deleted from the device storage system.

Properties

DeviceStorageChangeEvent.path Read only
A string giving the full path of the file affected by the change.
DeviceStorageChangeEvent.reason Read only
A string giving the reason of the change. Possible values are created, modified, or deleted.

Example

var sdcard = navigator.getDeviceStorage('sdcard');

sdcard.addEventListener("change", function (event) {
  var reason = event.reason;
  var path   = event.path;

  console.log('The file "' + path + '" has been ' + reason);
});

Specification

Not part of any specification.

See also

Document Tags and Contributors

 Contributors to this page: chrisdavidmills, fscholz, MHasan, kscarfone, teoli, Jeremie
 Last updated by: chrisdavidmills,