Click here to Skip to main content
14,601,060 members
Rate this:
Please Sign up or sign in to vote.
See more:
I want to lock folder.
And then only allow to access by trusted application.

What I have tried:

function lock_folder(string path){
...
}
function unlock_folder(string path){
...
}
function add_trusted_application(string appPath){
...
}
Posted
Comments
Richard MacCutchan 2-Mar-20 5:06am
   
Check the documentation for your OS to see how to protect folders.
Stefan_Lang 2-Mar-20 7:49am
   
"function add_trusted_application(string appPath)"

It is always the OS that will decide what is a trusted application, and which applications should be granted what access to any particular files! If the OS doesn't have the exclusive right on that, that opens the gates to all kinds of malicious software: Who would want an OS that allows a program to hide the folder that holds the malicious code which infects evrything?
Richard Deeming 3-Mar-20 7:24am
   
"Who would want an OS that allows a program to hide the folder that holds the malicious code which infects evrything?"
Seems like most commercial OSs have that option. It's mostly used by malicious software, but some poor attempts at DRM have used it as well.
Rootkit - Wikipedia[^]
masesk 19-May-20 22:13pm
   
You can use encryption methods/Libraries to “lock” a folder if you have write access to it. I don’t know what you mean by trusted application. Are you assuming the application that you are writing is trusted? Elaborate on that.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100