Question

There are two processes which will be accessing a file. Whenever, the file contents are modified in one process, I need to read the file and update something in the other process. Can you please tell me how to do this. I am not asking for code. just give the idea to do that. maybe some links, which would help me to acheive this. I saw something FindFirstChangeNotification for windows environment. I need something similar to this in linux environment

Thanks,

Était-ce utile?

La solution

Take a look at the python watchdog package. It provides cross platform file change monitoring, using a variety of techniques (depending on the platform). Even if you're not using python, you can use the ideas/techniques for the language of your choice. The watchdog page also mentions similar packages, should you be interested in further research.

Autres conseils

I ported some functions of Windows API to linux like (FindFirstChangeNotification, FindCloseChangeNotification) it has some limitations, but for what you need it must be enought, please take a look at: https://github.com/paulorb/FileMonitor It is a simple implementation that could run on windows/linux with the same functions definitions.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top