Click to See Complete Forum and Search --> : How can I lock the file ?


WINAPISTUDENT
January 16th, 2008, 01:06 PM
Hi all ...
I need write console application that getting a file path and lock the file ...
can someone show me the way how to start with this ?

kirants
January 16th, 2008, 01:09 PM
You can use CreateFile and open it in exclusive mode and keep it open for as long as you want the file locked.

Or,

you could use LockFile/LockFileEx APIs