QFileSystemWatcher vs KDirWatch

Andreas Pakulat apaku at gmx.de
Sat Jun 2 11:09:59 UTC 2007


On 02.06.07 12:57:43, Andreas Pakulat wrote:
> On 02.06.07 04:56:11, dukju ahn wrote:
> > Is the problem in KDirWatch is too serious to be usable? Because,
> > I found strange bug in QFileSysWatcher, especially for fileChanged().
> > 
> > In my simple test program, when I edit a file that is being monitored,
> > fileChanged() signal is emitted multiples of times. When the size of
> > file is small (up to few kilobytes) it is ok, but when filesize becomes
> > larger(300kb), same signal is emitted 20~30 times.
> > It caused application hanging because QTextStream should parse
> > that big fie 20~30 times again and again
> 
> That doesn't sound good, but I can't reproduce this here, so until
> otherwise found I think this is a system-specific problem.
> 
> Whats weird is that doing things like
> 
> echo foo >>test.txt doesn't trigger the signal...

I was kind of wrong, it does emit 2 times when you use something like

cat foo >test.txt

but thats fine, because the file is first cleared and then filled with
content again. Unless your kernel lacks inotify support you should see
the same. I think the kernel sends a changed signal through inotify
every time a write to the file happens.

Andreas

-- 
Keep it short for pithy sake.




More information about the KDevelop-devel mailing list