you have two issues to solve.
- file sharing. read and close file. to write open read/write not shared, so only one process can access at a time.
- conflict resolution. user one read file and makes changes. user two reads files, makes a change and saves. user one saves file. before the user one save it needs to re-read the file and make any changes made by user two. then apply the user one changes and save.