Fires when a file or folder is renamed inside the watched folder.

Parameters

string
required
The previous path, relative to the workspace root.
string
required
The new path, relative to the workspace root.

Behavior

  • Both paths must be inside the watcher’s scope. A rename that moves a file out of the watched folder reports OnDeleted instead, and one that moves a file in reports OnCreated.
  • Folder renames are reported too, as a single rename of the folder rather than one event per file inside it.

Example