Bug 315410 - KDirWatch - inotify - Any file operation is "dirty".
Summary: KDirWatch - inotify - Any file operation is "dirty".
Status: RESOLVED INTENTIONAL
Alias: None
Product: kio
Classification: Unmaintained
Component: general (show other bugs)
Version: 4.10.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-18 20:00 UTC by Mark
Modified: 2014-10-14 12:09 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark 2013-02-18 20:00:57 UTC
Hi,

I was playing with KDirWatch and noticed that any file operation that i do is being emitted as a "dirty" signal.

Create file: dirty signal (instead of created)
Modify file: dirty signal (might be fine, but i do get two additional signals here as well. Both of them with the directory in which the file is located. So 3 in total, 1 with the file path, 2 with the directory path)
Delete file: dirty signal (instead of created)

I tried debugging this a bit to narrow it down, but it's quite complicated. Mainly because of some timers in kdirwatch.cpp

Regards,
Mark
Comment 1 Dawit Alemayehu 2014-10-14 12:09:36 UTC
That is by design. The KDirWatch documentation clearly states:

  * 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().

So created and deleted are emitted for a particular directory you are watching iff the directory itself gets created and deleted. Otherwise, all you get is a dirty signal for anything that happens under that directory.