0

I have created one binary file in c that save btree.
File is having huge size around 2GB.

If some one changes this attribute to read only, then b tree is updated incorrectly. And the behavior of code changes.

I need to write a code, so that no can change file's attributes such as read only, hidden, etc. from outside.

Can any one help me?

3
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by namita.mundada
0

Thanks for the reply :)
No, Actually one service dumps data to file, and I want when that service is been started, no one can change file attributes.
e.g. Suppose my service is dumping data to file, and same time if any one make that file read only, then service cant write data to it.
So actually it is giving me error.
Did you understand the problem?

0

You could probably use some calls to FindFirstChangeNotification, and WaitForSingleObject api calls. Then whenever your app notices a change to the file.. it automatically changes the permissions back. Though, if you have access to the service that dumps data to the file... why not make the service simply check the file permissions (and if needed, change them....) on the line just before it dumps data to the file?

0

Yes I checked for permissions, but som how some data is missing, and this file contains offset of database file in form of btree, so I am getting some wrong data.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.