> For the complete documentation index, see [llms.txt](https://maya-admin.gitbook.io/building-skills/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://maya-admin.gitbook.io/building-skills/product/node-library/storage/watch-files.md).

# Watch Files

Watches a directory or file for changes.

### Inputs

This is a trigger node so it has no inputs.

### Outputs

The full filename of the file that actually changed is put into `msg.payload` and `msg.filename`, while a stringified version of the watch list is returned in `msg.topic`.

![](https://1551505950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mkaq90Au3F8Kz0qIFzO%2Fuploads%2Fgit-blob-4e77d3526410cbe11f9758aac5650678015d827f%2Fimage.png?alt=media)

### Details

You can enter a list of comma separated directories and/or files. You will need to put quotes "..." around any that have spaces in.

On Windows you must use double back-slashes \\\ in any directory names.

The full filename of the file that actually changed is put into `msg.payload` and `msg.filename`, while a stringified version of the watch list is returned in `msg.topic`.

`msg.file` contains just the short filename of the file that changed. `msg.type` has the type of thing changed, usually *file* or *directory*, while `msg.size` holds the file size in bytes.

Of course in Linux, *everything* is a file and thus can be watched...

\*\*Note: \*\*The directory or file must exist in order to be watched. If the file or directory gets deleted it may no longer be monitored even if it gets re-created.
