Although the title mentions file, it doesn't have to be a file. Any locking mechanism would do.
Here is the situation: I have a daemon process written in C, and a web page in php. I'd like to have a way of mutual locking so that under certain situation, the C daemon would lock a file and php detects the situation and tells the client side that the system is busy.
Is there an easy way of doing this?
Thanks,