Thread: Can we have a daemon process sleeping until a file is created, using C/C++ in window

  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    7

    Smile 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

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  3. #3
    Registered User
    Join Date
    Nov 2008
    Posts
    7
    Thanks dude.

    This seems to be doable. I am quite new to this windows C++ programming. Can you suggest any book or tutorial. I just require a mediocre knowledge, only for this particular proj.

    Thanks for the help.

  4. #4
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Quote Originally Posted by Krsh View Post
    Thanks dude.

    This seems to be doable. I am quite new to this windows C++ programming. Can you suggest any book or tutorial. I just require a mediocre knowledge, only for this particular proj.

    Thanks for the help.
    Have you already read this
    http://cboard.cprogramming.com/showthread.php?t=79619

    and this

    http://cboard.cprogramming.com/showthread.php?t=74078

    ?
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Newbie homework help
    By fossage in forum C Programming
    Replies: 3
    Last Post: 04-30-2009, 04:27 PM
  2. Just starting Windows Programming, School me!
    By Shamino in forum Windows Programming
    Replies: 17
    Last Post: 02-22-2008, 08:14 AM
  3. Can we have vector of vector?
    By ketu1 in forum C++ Programming
    Replies: 24
    Last Post: 01-03-2008, 05:02 AM
  4. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM
  5. Invoking MSWord
    By Donn in forum C Programming
    Replies: 21
    Last Post: 09-08-2001, 04:08 PM