Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900