0

I would like in a software to log: which processes are accessing a file and how to force free file from access by others processes (is it possible with API window?) notice that you are enable to open a file with notepad and delete this file in disk without kill notepad.but for other program like word excel it is not possible. so there some program that lock resource other no.It means you can free but how? secondly it is possible that for some process they crash when you free but in my case it was only custom services that access those files Thank you

7
  • Don't know about the exact details, but wouldn't that seem like something very dangerous to allow? Commented Aug 16, 2012 at 3:57
  • I don't think you can free a file. You would have to kill the process that is holding it. Commented Aug 16, 2012 at 3:58
  • because files I talk about can be accessed only by custom service there is no mistake. Other services have their try catch IOException ;-) what i want isn't kill the other process only free file accessed Commented Aug 16, 2012 at 4:00
  • @nunespascal you will notice that you are enable to open a file with notepad and delete this file in disk without kill notepad.but for other program like word excel it is not possible. so there some program that lock resource other no.It means you can free but how? secondly it is possible that for some process they crash when you free but in my case it was only custom services that access those files Commented Aug 16, 2012 at 4:04
  • Yes, that depends on what lock the application acquires while opening the file. If it is your program that has the locks, why not open files with shared locks? Commented Aug 16, 2012 at 4:30

1 Answer 1

1

Please look at

http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/37dc9843-2583-41fc-8260-b78183aa4bed/

This might be of some help.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.