|  | Home · Overviews · Examples |

# QFileSystemWatcher Class Reference
[com.trolltech.qt.core module]

The `QFileSystemWatcher` class provides an interface for monitoring files and directories for modifications. More...

Inherits `QObject`.

## Detailed Description

The `QFileSystemWatcher` class provides an interface for monitoring files and directories for modifications.

`QFileSystemWatcher` monitors the file system for changes to files and directories by watching a list of specified paths.

Call `addPath` to watch a particular file or directory. Multiple paths can be added using the `addPaths` function. Existing paths can be removed by using the `removePath` and `removePaths` functions.

`QFileSystemWatcher` examines each path added to it. Files that have been added to the `QFileSystemWatcher` can be accessed using the `files` function, and directories using the `directories` function.

The `fileChanged` signal is emitted when a file has been modified or removed from disk. Similarly, the `directoryChanged` signal is emitted when a directory or its contents is modified or removed. Note that `QFileSystemWatcher` stops monitoring files and directories once they have been removed from disk.

See also `QFile` and `QDir`.