-
February 26th, 2008, 12:16 PM
#1
Protecting a folder from being deleted
I have an application that depends upon a folder existing on the system and I want to prevent the user from being able to delete it. The only way I can think of is to create a dummy file within the folder and keep an active file handle open upon it. This is fine, but I was wondering if there was a more elegant and/or established way of doing this.
My application is activated when the system starts and ends when the system shuts down.
Why are the "tolerant" so easy to offend?
-
February 26th, 2008, 04:57 PM
#2
Re: Protecting a folder from being deleted
What do you by "depends upon a folder existing" ? Just the existence? Or it depends on the data you have in the folder?
Cheers
-
February 26th, 2008, 06:02 PM
#3
Re: Protecting a folder from being deleted
What about using permission on folder to disable deleting it?
-
February 27th, 2008, 11:38 AM
#4
Re: Protecting a folder from being deleted
I believe deleting is the same as writing, so disabling write permission should disable deleting.
Look up the SetFileSecurity() function.
This should do the trick.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|