Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The file is locked at initialization of application. So In application I want to delete a file. But since the file is locked I can not Unlock the file without stream object. But as the file is locked at initialization I don't have have stream object.

I got list of file locked by process using GetFilesLocked() function found on internet.

What I have tried:

I searched on google, Where I got solution to use unlocker.exe or close application which is not feasible to my problem.
Posted
Updated 18-Nov-16 1:25am

1 solution

What would the point of file locks be if you could simply ignore them? It would be like having a lock on a door and beside it a button saying "If you don't have a key push this button to open the door".

Re-architect your code so that you don't keep the file locked, or have a mechanism where you can tell whatever is locking the file to unlock it when you want to delete it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900