VolumeWatcher

VolumeWatcherModule. VolumeWatcher

new VolumeWatcher()

Description:
  • Monitors file system objects for changes.

Source:

Extends

  • EventEmitter

Methods

(async) AddWatches(watchList) → {Promise}

Description:
  • Add or replace file system objects to be monitored

Source:
Parameters:
Name Type Description
watchList Array.<object>

Array of objects containing watch information.

Properties
Name Type Attributes Description
target string

Path of the target to be watched.

recursive boolean <optional>

Flag indicating that the target should be recursed for change monitoring (if a directory)

ignoreAccess boolean <optional>

Flag indicating that the access to the target should be ignored.

Throws:
  • Thrown if 'watchList' does is not an array of objects.
Type
TypeError
Returns:
  • A promise that when resolved will indicate if the watch targets were added.
Type
Promise

DeleteWatch(target) → {boolean}

Description:
  • Delete a watch

Source:
Parameters:
Name Type Description
target string

Oatg ti tge watch to be removed.

Returns:
  • trye if the watch item was deleted.
Type
boolean

ListWatches() → {Array.<string>}

Description:
  • Provide a list of the watch targets

Source:
Returns:
  • Array of the watch targets
Type
Array.<string>

Terminate() → {void}

Description:
  • Destructor

Source:
Returns:
Type
void

(async) ValidateAccess(target, accessMode) → {Promise.<object>}

Description:
  • Check to see if the current process has access to the specified target.

Source:
Parameters:
Name Type Description
target string

File system target.

accessMode number

Mode for the access being sought.

Returns:

Promise to validate the status of the item specified.

Type
Promise.<object>