I have two game accounts in a game that allows addons. The addons save their data into files. Whenever the game is closed (from a manual close, a disconnect, a crash, etc.), the game writes to the specific account's data file. So, for any given addon, each account has a separate data file.
What I'd like to accomplish is to share the data between both accounts while allowing only one of the accounts to write data to the file. While I could purposely log them out in a particular order to make sure that the correct account is the one that actually writes to the file, I don't always have control over logouts in the event of server or client crashes.
Let's say the data files are arranged like this:
C:\Games\GameTitle\Data\PrimaryAccount\addonDataFile.txt
C:\Games\GameTitle\Data\SecondaryAccount\addonDataFile.txt
I would like the first file to be treated like the second file while being read, but to deny any writes to the second file when an attempt is made to write to it. As far as I'm aware, a symlink in Windows only meets the first criteria.
Is there a way to make a read-only symlink to a file, preventing writes from being made via the symlink?