0

I have config.ini file that is edited by multiple Python scripts simultaneously and I am facing large issue here because when updating, some values get restored and it messes up everything... I can't use

config.read("config.ini")

every time I need to update one value because high HDD activity causes scripts to not be synchronised, and after few loop passes everything collapses again.

So, how do I change only one value?

Mirac7
  • 1,566
  • 4
  • 26
  • 44
  • 1
    Sounds like you're using a config file for something other than its intended purpose -- so the fix might be use something else that better supports concurrency and frequent updates. – martineau Mar 27 '13 at 13:43

1 Answers1

0

Ok either you want to use a database instead of a config file or you need to use stat to see if a file has been modified or you want to use inotify. Pyinotify can detect if there is a filechange and alert through an event.

For examples see the Pyinotify website

kugg
  • 1,727
  • 1
  • 10
  • 5