Class FolderMonitor

Allows monitoring a file system folder for changes. Depending on the flags set this monitor can notify you when file is changed/moved/renamed and similar.

Hierarchy

  • FrameworkObject
    • FolderMonitor

Constructors

Properties

Methods

Events

Constructors

  • Create a new folder monitor monitoring a folder.

    Parameters

    • folderPath: FilePath

      The path to the folder to monitor.

    • subdirectories: boolean
    • changeFilter: EnumValue<FolderChangeFlag, number>
    • OptionalisInternalConstructor: boolean

    Returns FolderMonitor

Methods

  • Destroy the monitor and stop monitoring.

    Returns void

Events

onModified: Event<[FilePath], void>

Triggers when a file in the monitored folder is modified. Provides absolute path to the file.

onAdded: Event<[FilePath], void>

Triggers when a file/folder is added in the monitored folder. Provides absolute path to the file/folder.

onRemoved: Event<[FilePath], void>

Triggers when a file/folder is removed from the monitored folder. Provides absolute path to the file/folder.

onRenamed: Event<[FilePath, FilePath], void>

Triggers when a file/folder is renamed in the monitored folder. Provides absolute path with old and new names.