When one program has opened a file for the purpose of updating it, no other program should be allowed to update the file at the same time. Managing concurrent updates is not an operating system task, it's a database task.
To test: open a .txt file in Notepad, then open it in Wordpad. In Wordpad enter the word "wordpad", save the file and exit Wordpad. In Notepad, write the word "notepad", save the file and exit Notepad. Open it next, in either program, and you'll see that the file no longer has the word "wordpad".
Source:→ Michael Horowitz