Quote Originally Posted by vermarajeev View Post
What do you mean when you talk pseudolock???
Well, the mechanism you describe doesn't do any locking, so I called it a pseudolock.

Can I provide some safety mechanism using the above specified solution by me???
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.

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.
You can use different mechanisms on different platforms.

What API's????
http://en.wikipedia.org/wiki/API