Connecting Tech Pros Worldwide Help | Site Map

How can a folder be locked?

Member
 
Join Date: Mar 2008
Posts: 101
#1: 2 Weeks Ago
How can a folder be locked?I am working on some logic
Ist Program
1. to create a folder // done
2. write all the files in the directory generated in the program // done
3. lock the folder //How it can be done?

IInd Program
open the directory (by unlocking) // How it can be done?
read and execute the file. //possbile

Thanks in advance.
Banfa's Avatar
AdministratorVoR
 
Join Date: Feb 2006
Location: South West UK
Posts: 6,158
#2: 2 Weeks Ago

re: How can a folder be locked?


I think you would first need to ascertain what "locked" means in this context, then we may be able to suggest ways to do it.

For instance does it mean just set the read only flag?
Member
 
Join Date: Mar 2008
Posts: 101
#3: 2 Weeks Ago

re: How can a folder be locked?


LOck means, no one can open and see the content in the folder and other program in C++ read and execute it. Thanks in advance.
Banfa's Avatar
AdministratorVoR
 
Join Date: Feb 2006
Location: South West UK
Posts: 6,158
#4: 2 Weeks Ago

re: How can a folder be locked?


That is clearly not possible because the only way to access any folder or file is to use a program.

If you are using a system that supports user accounts you could create a special user account and make the folder owned by that account and then only grant access rights to that user and then only that user and any administrators of the system would be able to access the folder/files.

Then in your programs you could access the folder using that user.
Newbie
 
Join Date: Jul 2008
Posts: 26
#5: 2 Weeks Ago

re: How can a folder be locked?


> That is clearly not possible

On Windows, simply use Security apis.
Reply