xmltv: better handle file replace

Authored by mauroc on Mar 12 2019, 4:26 PM.

Description

xmltv: better handle file replace

When a xmltv file is replaced, QFileSystemWatcher (with is based
on Kernel inotify ioctl) stops monitoring the file. To avoid
that, remove and re-insert the file while parsing it.

It should be noticed that a script that would be doing
something like:
$ rm file
$ xmltv-grabber-foo >file

will still fail, as we can't ask inotify to monitor a
file that doesn't exist. Well, we could, instead monitor
the directory and check for a file creation, but that
would be a little more complex. So, the recommended
way would be to do:

$ xmltv-grabber-foo >file.new
$ mv file.new file

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

Details

Committed
maurocMar 12 2019, 5:31 PM
Parents
R466:69039dee1aa1: xmltv: improve parser to get more fields
Branches
Unknown
Tags
Unknown