PDA

View Full Version : QFileSystemWatcher



Kumosan
17th March 2008, 08:18
Anybody experiences with this?
What I'd like to know is when does the fileChanged signal fires? When I start writing a file, or when the operation is completed? For instance, when I write a 1GB file there is quite a difference between the start of the write and its completion.

I admit, under Linux I could try it myself, but this still wouldn't tell me whether the behaviour is defined and can be expected to work the same under all platforms.

wysota
17th March 2008, 23:30
Hi Guido,

The class probably reacts to changes in the meta-data associated with the file and that will in general get updated after the write is complete (especially now that we have journalling file systems). But probably the best answer is "it depends on the file system".

Mhondoz
18th March 2008, 20:52
As for experience, I am using it for a tool that parses a log file from an external application (on Windows). So I let the QFileSystemWatcher notify my program when there is new data in the logfile.

Unfortunately I do not know when or what actually causes the signal to be triggered, but I think wysota is right that it is when the meta data about the file is changed in the file system.