Well, the mechanism you describe doesn't do any locking, so I called it a pseudolock.
If you can get some process identifier on Windows then yes. Store the PID along the filename which the particular process handles in your lock data and then when you want to open the same file check if a process with this identifier exists. If not, it means that the entry is stale and can be removed.Can I provide some safety mechanism using the above specified solution by me???
You can use different mechanisms on different platforms.The solution I'm looking should be portable and as per my searching I didnt get any. I came across semaphores too but found that it works for linux.
http://en.wikipedia.org/wiki/APIWhat API's????
Bookmarks