Linux File Locking Mechanism
Hi Folks,
I have a situation where the one process 1 is writing files on Linux server and process 2 is polling for newly created files and reads them , making a copy and passes to another process. Now, I want to know that is it possible that process 2 can read a file before the process 1 completely write it. Is there any kind of automatic kinda locking mechanism in Linux which stops process 2 to read the file before process 1 completely write it. Any kind of help will be appreciable. Thanks, Samrat. |
Named pipes/FIFOs might be one option. For a quick introduction, see for example this page on Linux Journal. The idea is that one program writes to a special place and the other one reads when it finds information there.
|
All times are GMT -5. The time now is 06:28 AM. |