launchd-Daemons run every second

Discussion in 'Mac Programming' started by mehdies, Nov 13, 2012.

  1. macrumors member

    Joined:
    Jun 10, 2012
    #1
    Hi guys,

    How i create a .plist file in /Library/LaunchDaemons that runs a executable file every second?

    i mean my application execute every second.


    thanks
     
  2. macrumors member

    Joined:
    Jul 4, 2010
  3. macrumors 68040

    Joined:
    Feb 2, 2008
    #3
    What are you trying to do exactly? With a 1 second time frame it sounds like you would want to keep the application alive and run it in a loop with a one second sleep instead.
     
  4. thread starter macrumors member

    Joined:
    Jun 10, 2012
    #4

    Yes,I exactly want to keep application alive.how can i do that?
     
  5. macrumors 68040

    Joined:
    Feb 2, 2008
    #5
    With launchd and by setting a KeepAlive property to true in the property list that is associated with your program/script. The reason I asked what you where doing is that it sounds suspiciously much like polling and there may be better options available.
     
  6. thread starter macrumors member

    Joined:
    Jun 10, 2012
    #6
    I have an application .... this application has connection with kernel(a kext) and get a buffer from kext and write to file.i want to increase speed of getting and writing process so when buffer has even 1 character my daemon get that and write to file.
    My application must check the buffer consecutive.
    Now could you help me?


    Thanks
     
  7. macrumors 68040

    Joined:
    Feb 2, 2008
    #7
    I did, use the KeepAlive property and set it to true in your property list. I don't know off the top of my head what options you have besides polling in your particular case, but it's probably worth investigating.
     

Share This Page