So I've got a situation where programX.py creates files such as file1.txt.
How could one make it so that only programX.py has the rights to edit (write to) file1.txt?
So anything else (such as a user) cannot edit file1.txt - they would only be able to read from it.
I've read up about digital signatures (gpg), but I'm not sure if it would be feasible in terms of system resources to unlock the file -> write -> lock file whenever there is something to be written to the file.
Ideally, the (read-only except for programX.py) mechanism would already be applied to the file under its properties when it is created by programX.py for the first time - that way there would be no need to be constantly unlocking and locking the files.