Questions tagged [qfilesystemwatcher]

A QFileSystemWatcher is a class from the Qt toolkit which 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.

It emits signals whenever a file has been modified, renamed or removed from disk, or when a directory or its contents is modified or removed.

The official Qt documenation can be found here for Qt 4.8 or here for Qt 5.

47 questions
1
vote
1 answer

How to update file info in a QFileSystemModel?

First of all, this question is similar to this other one QFileSystemModel not updating when files change with the main difference than in this case I don't want to replace the entire model each time one of my files are updated. In the real world…
BPL
  • 9,632
  • 9
  • 59
  • 117
1
vote
1 answer

QFileSystemWatcher error handling with PySide/PyQt - Python 3.x

My program utilises Qt's QFileSystemWatcher function to monitor a network directory (not on the local machine itself) for changes, and then run a script when a change is found. This function performs as required for the most part. The program is…
jars121
  • 1,127
  • 2
  • 20
  • 35
1
vote
1 answer

When I get directoryChanged signal from QFileSystemWatecher the file newly added is not completed to read

I want to be notified when a file is added to "/test". So I used QFilesystemWatcher's directoryChanged signal. But when "cp aa.txt /test" I got directoryChanged signal and there when I read aa.txt I had incomplete aa.txt. In this case how can I…
user150497
  • 490
  • 4
  • 14
1
vote
0 answers

Python output from Popen command from inside a thread into a GUI form in real time

Being new to Python I have looked around the site and found partial answers but nothing that helps make things clear. This is what I have. The main window through a button activates the thread which runs a command (wash -C -i monX) and a table needs…
1
vote
1 answer

How to only emit one directoryChanged signal with QFileSystemWatcher

Here's the basic premise of my application: I've established a QFileSystemWatcher to watch a directory. Path = [r'C:\Users\user\Documents\Images'] DirectoryWatcher =…
jars121
  • 1,127
  • 2
  • 20
  • 35
1
vote
1 answer

Better way of using QFileSystemWatcher to import data files as they are generated?

I am using PyQt4 to write an application that monitors a folder, and imports data (contained in sub-folders) as it is collected so that analysis can be run on it as the data is generated. Essentially, the way that the data collection software works…
dan_g
  • 2,712
  • 5
  • 25
  • 44
1
vote
1 answer

Calling a class method in Python/PySide

I spent longer than I'd care to admit think of a suitable 'question' heading for this topic, as my issue is somewhat hard to articulate. Here is a quick summary of the situation: I'm writing a basic GUI with Python 3.4 and PySide I'm using…
jars121
  • 1,127
  • 2
  • 20
  • 35
1
vote
1 answer

Monitoring file integrity

I would like to write a simple application that tells me when a file has been modified. Does the class only monitor changes when the program is running? If so, are there any other classes that I can use for file integrity…
Quaxton Hale
  • 2,460
  • 5
  • 40
  • 71
1
vote
1 answer

How to obtain the changed file names from the QFileSystemWatcher `directoryChanged` event

How can one obtain the changed file names from the QFileSystemWatcher directoryChanged event?
Stalin
  • 25
  • 4
1
vote
3 answers

why the program exits after i press Ok

I have written a program that watches over a directory and alerts when a file is added by a user, the file has specific format as user-name.files it works fine but when I press ok of the alert received of new file being added, the program exits, I…
Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197
1
vote
1 answer

Qt signal driven tail program

I'm looking to create a simple 'tail' type program which prints out new lines appended onto a file. Instead of constantly polling the file stat for an updated modified date, is there a way to catch a signal when: The file has been appended to The…
TSG
  • 4,242
  • 9
  • 61
  • 121
1
vote
2 answers

Why does QFileSystemWatcher work for directories but not files in Python?

I borrowed this code from another StackOverflow answer: from PyQt4 import QtCore @QtCore.pyqtSlot(str) def directory_changed(path): print('Directory Changed!!!') @QtCore.pyqtSlot(str) def file_changed(path): print('File…
Ken Kinder
  • 12,654
  • 6
  • 50
  • 70
0
votes
0 answers

QFileSystemWatcher fails to get notified when /var/log/system.log changes on OSX

After many attempts trying to keep up with the changes in OSX's /var/log/system.log using QFileSystemWatcher I am still unable to make it work. My QXLogWidget class has a method to set the file path to watched: void QXLogWidget::setLogPath(QString…
coterobarros
  • 941
  • 1
  • 16
  • 25
0
votes
0 answers

how to stop my FileSystemWatcher in start/stop button

I have a FileSystemWatchers monitoring 1 location in a Start/stop Button, but I can´t manage to stop it, the button works pretty much well as when I click on it, it reads the code when it is off (the text changes to "start Watching") but it does not…
0
votes
0 answers

QFileSystemWatcher fired only one time

I'm writing QtVsPlayer https://github.com/surfzoid/QtVsPlayer I add a QFileSystemWatcher in this way : .h private: QFileSystemWatcher *watcher; private slots: void showModified(const QString& str); .cpp QtVsPlayer::QtVsPlayer(QWidget…