Logo Search packages:      
Sourcecode: basket version File versions  Download package

KDirWatch Class Reference

#include <kdirwatch.h>

List of all members.


Detailed Description

Class for watching directory and file changes.

Watch directories and files for changes. The watched directories or files don't have to exist yet.

When a watched directory is changed, i.e. when files therein are created or deleted, KDirWatch will emit the signal dirty().

When a watched, but previously not existing directory gets created, KDirWatch will emit the signal created().

When a watched directory gets deleted, KDirWatch will emit the signal deleted(). The directory is still watched for new creation.

When a watched file is changed, i.e. attributes changed or written to, KDirWatch will emit the signal dirty().

Scanning of particular directories or files can be stopped temporarily and restarted. The whole class can be stopped and restarted. Directories and files can be added/removed from the list in any state.

The implementation uses the FAM service when available; if FAM is not available, the DNOTIFY functionality is used on LINUX. As a last resort, a regular polling for change of modification times is done; the polling interval is a global config option: DirWatch/PollInterval and DirWatch/NFSPollInterval for NFS mounted directories.

See also:
self()
Author:
Sven Radej <sven@lisa.exp.univie.ac.at>

Definition at line 70 of file kdirwatch.h.


Public Types

enum  Method { FAM, DNotify, Stat }

Signals

void created (const QString &path)
void deleted (const QString &path)
void dirty (const QString &path)

Public Member Functions

void addDir (const QString &path, bool watchFiles=false, bool recursive=false)
void addFile (const QString &file)
bool contains (const QString &path) const
QDateTime ctime (const QString &path)
Method internalMethod ()
bool isStopped ()
 KDirWatch (QObject *parent=0, const char *name=0)
void removeDir (const QString &path)
void removeFile (const QString &file)
bool restartDirScan (const QString &path)
void setCreated (const QString &path)
void setDeleted (const QString &path)
void setDirty (const QString &path)
void startScan (bool notify=false, bool skippedToo=false)
bool stopDirScan (const QString &path)
void stopScan ()
 ~KDirWatch ()

Static Public Member Functions

static bool exists ()
static KDirWatchself ()
static void statistics ()

Private Attributes

bool _isStopped
KDirWatchPrivate * d

Static Private Attributes

static KDirWatchs_pSelf = 0L

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index