How to give read and write access to a specific directory to a specific program?

windows and linux have permission management for users (groups). Can you also set read and write permissions for specific programs (processes)?
if possible, please point out the operation methods under win10 and linux.


an idea:
Linux can create a separate user, use that user to run the program, and then use chown to change the directory to that user's. In this way, the program can only operate the files in this directory, but it can still read the files in other directories.

if you really want to do a good job of quarantine, you are advised to use docker directly.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be00f9-30c50.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be00f9-30c50.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?