Thread: Clips bar empty
View Single Post
Old 09-27-2017, 01:37 AM   #48
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,438
Karma: 27757438
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
This should be easy to fix by simply using atomic writes for the config file. i.e. have the code that writes the config file write to temp file and rename the temp file to the original after the write is complete.

The file system watcher should notify you about the rename and you are guaranteed that when the rename arrives, the file contents are updated.

Last edited by kovidgoyal; 09-27-2017 at 01:39 AM.
kovidgoyal is offline   Reply With Quote