Can we have a daemon process sleeping until a file is created, using C/C++ in window
Hi,
Can we have a daemon process that sleeps until a file is created( like a blocked file open) and when the file is created does some job and then deletes the file, sleeps again until the file is created again
The program can be like
Code:
while() //daemon process, indefinite loop
{
until the file is created ( sleep ) // this will not be polling, but a blocked mode
<do a job> // now that the file is created
< delete the file >
}
I want this for an asynchronous communication between a solaris server and a awindows machine. When a particular event happens Solaris server will create a file and ftp that to the windows machine. The process in the windows machine, on arrival of the file will wake up and do a particular job assciated with that event, delete the file and sleep again
Thanks in advance