What operating system is this intended to run on?
Cross Platform
Why don't you just encrypt the data being written?
I'm more interested in preventing accidental, or deliberate, changing of the files. I guess it's very unlikely - maybe I'm worrying too much.
Cross-platform will be a little trickier. You'll probably have to IFDEF your way through this one.
Can you elaborate on the type of issue you are looking to address? Real world scenarios.
It *might* be that you are worrying too much, but the scenarios will help. If the files are available for a long time, then perhaps it makes sense, but if they are transitory, then...
If there is that much concern, better to run the app in a specific user context, and have it write to folders granting it only the permission needed.
In most OSes, it wouldn't be too difficult at all to create a random credential, and use it for access to the location in question.
But it sure feels like this is a solution in search of a problem.
If you put an exclusive lock on the files you are using, nothing else will be able to touch them.
And, as several folks have pointed out, any person with admin access AND local access, will ultimately be able to access those files. All you can do is slow them down, or hope they are not too serious.