single application file access

  • Thread starter Thread starter yuvalt
  • Start date Start date
Y

yuvalt

Hello,
I would like to know if there is any option to allow a certain
application to access a file, and prevent any other operation on this
file by other applications, especially deletion.
Thank you!
 
If this is a file you've created just for your app, then nothing other
app will access it. If you didn't create the file, open it and don't
close it until your app closes. This will prevent other apps from
accessing the file.

Brett
 
Thank you Brett!
What do you mean by conditioning a file access by its creator? My app
creates normal txt files for instant which I would like to be safe from
deletion. Except for hiding them what solutions do I have against
someone/another app' messing with them?
Thanks again.
yuval
 
Since your app created the files and haven't made them known to any
other app, there shouldn't be a problem with them being deleted. No
one but you knows they are there. Why do you believe another app will
delete them when they don't know what to go after for deleting? Have
you seen some type of behavorior that puts your file at risk?

Assuming you have no delete commands for the files in your app and
unless some rogue app is scanning files and deleting txt extensions at
will, you should be fine.

You can place the app into a directory, define security on that
directory and use polices in your app to better protect the file but
that is overkill in most situations.

Brett
 
Brett, thank you very much for the quick response.
The app creats files within a directory which is accessible to all
apps. What do you mean by creating it FOR my app? Is there an option to
detain anyone from touching the file (except fro reading)? I know I can
create a hidden file but
 
Thank you Brett!
What do you mean by conditioning a file access by its creator? My app
creates normal txt files for instant which I would like to be safe from
deletion. Except for hiding them what solutions do I have against
someone/another app' messing with them?
Thanks again.
yuval
 
Hi again Brett,
Sorry for not making myself clear. I need to take into consideration
that someone is trying to mess around with my app's files and has
delete comms. Im looking for a way to protect them, be it by password
or somekind of id held by my app' alone.
 
You can lock the file by keeping it open while your app is running.
That will keep it from being deleted. When your app is not running,
create a Windows role for your user, add that as the only role to the
special directory your file is stored in. Then use the Policy class in
..NET to access that file per the security you've configured on the
Directory. Possibly just configuring by user instead of role will
work. Of course, if some one is the admin, they can change all of
that.

Brett
 
Back
Top